Bug 366125 - Naming conventions
Summary: Naming conventions
Status: RESOLVED WONTFIX
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 0.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2011-12-08 18:37 EST by Mark Macdonald CLA
Modified: 2015-05-05 16:00 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2011-12-08 18:37:00 EST
I tried to follow convention for a new service I was creating, but apparently there's less of a convention than I thought. Here are some places I saw inconsistencies:

Service ids
-----------
The wiki [1] says that these are Java-style reverse DNS names, which would mean lowercase is preferred. I found a few mixedCase names in use:
  orion.navigate.openWith
  orion.navigate.openWith.default
  orion.edit.contentAssist
  orion.core.linkScanner
  editorAction (may be obsolete)


Event types
-----------
  TextView and Editor use CamelCase ("ModelChanging", "InputChanged", etc)
  ContentAssist uses lowercase ("accept")
  Services that dispatch events use lowercase ("favoritesChanged", "syntaxChecked", "pluginRemoved", etc)

 
[1] http://wiki.eclipse.org/Orion/Coding_conventions#Services
Comment 1 Mark Macdonald CLA 2012-04-11 13:52:34 EDT
If we're going to make changes to the service IDs, 0.5 is the right time to do it.

Any breaking changes will have to be noted here:
http://wiki.eclipse.org/Orion/Plugin_API_Changes/R0.5
Comment 2 Simon Kaegi CLA 2012-05-28 12:37:12 EDT
Would be good to look at making what we have consistent.
Comment 3 John Arthorne CLA 2012-05-28 13:23:40 EDT
We should be careful about making sweeping changes at this point in 0.5 because it tends to take us awhile to track down all the plugins that need fixing. I am happy to take this as an item for 1.0 cycle.
Comment 4 John Arthorne CLA 2012-05-30 15:26:48 EDT
Another service that desperately needs a name change is orion.core.contenttypes. This is a service that provides access to the list of registered content types. This is an internal service to be used by Orion pages, not by plugins. Note there is also orion.core.contenttype (no "s") which is used by plugins to register content types. The first one should be renamed to something like orion.core.contentTypeDirectory or orion.core.contentTypeRegistry to be clear it provides access to contenttype info, rather than declaring them.
Comment 5 John Arthorne CLA 2012-10-01 09:40:10 EDT
Simon, can you suggest a naming convention for events? camelCase or TitleCase?
Comment 6 Simon Kaegi CLA 2012-10-01 10:08:35 EDT
I'd suggest camelCase although I would stick to a single lower case word unless there's a good reason -- so "selected", "started" and "removed" are good and "unicornJumped" if you must. You can use a capital if the first word is obviously a capital or acronym -- e.g. DOMActivate.

Our eventing is mainly inspired from W3C EventTarget -- http://www.w3.org/TR/DOM-Level-3-Events/ which for historical reasons mainly used pure lower case so you get things like "mouseover" and "mouseout". This was always confusing and in nearly all recent event libraries they use camelCase -- e.g. JQuery, Dojo, Node -- so that's my suggestion although I think in most cases a lower case single word is sufficient.
Comment 7 John Arthorne CLA 2015-05-05 15:47:14 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html
Comment 8 John Arthorne CLA 2015-05-05 16:00:52 EDT
Closing as part of a mass clean up of inactive bugs. Please reopen if this problem still occurs or is relevant to you. For more details see:


https://dev.eclipse.org/mhonarc/lists/orion-dev/msg03444.html