Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Genmodel package conventions
Genmodel package conventions [message #417468] Wed, 12 March 2008 00:26 Go to next message
Juan  omínguez is currently offline Juan omínguezFriend
Messages: 12
Registered: July 2009
Junior Member
Egen, by default, allows to use package suffixes to separate
implementation, interface, metadata, etc, packages.

Typical package layout is (assuming "com.example" as base package and
"EMFExample" as prefix):

com.example.EMFExample: for interfaces
com.example.EMFExample.impl: for implementor classes
com.example.EMFExample.presentation: for editor classes
.... and so on.

¿Is there any way to configure EMF so that it generates the package
naming conventions used, for example, in JDT model?:

com.example.EMFExample: for interfaces
com.example.internal.EMFExample: for implementor classes
com.example.ui.EMFExample: for editor classes
.... and so on.
Re: Genmodel package conventions [message #417472 is a reply to message #417468] Wed, 12 March 2008 12:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Juan,

Comments below.


Juan Domínguez wrote:
> Egen, by default, allows to use package suffixes to separate
> implementation, interface, metadata, etc, packages.
>
> Typical package layout is (assuming "com.example" as base package and
> "EMFExample" as prefix):
>
> com.example.EMFExample: for interfaces
> com.example.EMFExample.impl: for implementor classes
> com.example.EMFExample.presentation: for editor classes
> .... and so on.
The prefix affects the name of XyzPackageImpl, XyzFactoryImpl,
XyzSwitch, and so on, not the name of the qualifying package. So
EMFExample above is controlled by the name of the EPackage.
>
> ¿Is there any way to configure EMF so that it generates the package
> naming conventions used, for example, in JDT model?:
>
> com.example.EMFExample: for interfaces
> com.example.internal.EMFExample: for implementor classes
> com.example.ui.EMFExample: for editor classes
> .... and so on.
If you made your EPackage's name be "example" and made the base package
be "com" then you could achieve this by specifying whatever else you
want in the Package Suffixes. Personally, I think the internal
qualifier is best to go after the part of the package that uniquely
identifies your model. After all, it's org.eclipse.jdt.internal, not
org.eclipse.internal.jdt.. The naming conventions for internal packages
only states that internal is used as one of the package names, not what
position within the full qualification is should appear at...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Genmodel package conventions [message #417479 is a reply to message #417472] Wed, 12 March 2008 21:05 Go to previous message
Juan  omínguez is currently offline Juan omínguezFriend
Messages: 12
Registered: July 2009
Junior Member
> If you made your EPackage's name be "example" and made the base package
> be "com" then you could achieve this by specifying whatever else you
> want in the Package Suffixes. Personally, I think the internal
> qualifier is best to go after the part of the package that uniquely
> identifies your model. After all, it's org.eclipse.jdt.internal, not
> org.eclipse.internal.jdt.. The naming conventions for internal packages
> only states that internal is used as one of the package names, not what
> position within the full qualification is should appear at...

Good point: it's org.eclipse.jdt.internal, not org.eclipse.internal.jdt

But, there are subpackages inside org.eclipse.jdt.internal, such as:

org.eclipse.jdt.internal.compiler
org.eclipse.jdt.internal.compiler.ast

And not

org.eclipse.jdt.compiler.internal
org.eclipse.jdt.compiler.ast.internal,

so an "infix notion" for internal/impl packages, before the the part
that identifies the model is used...

Perhaps it's used because it's easier to exclude all
org.eclipse.jdt.internal.* packages, or perhaps its used because that
convention tends to group internal packages together in the package
explorer (I vote for that one! :)
Previous Topic:EMF WSDL Xmlschema
Next Topic:EPackage global registry
Goto Forum:
  


Current Time: Fri Apr 26 11:12:00 GMT 2024

Powered by FUDForum. Page generated in 0.03748 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top