[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [dali-dev] Implementing new features
|
Hi,
I remember a conf call were being setup, but i don't remember getting an
actual time/date/number....?
/max
Hey guys,
As requested in our morning meeting here is a list of things that need
to be
updated to add a new feature and implement the necessary code to update
our
model to and from the JDT model.
1. Edit dali.ecore and generate the model and edit layers.
2. Create a new adapter interface (or modify the appropriate existing
one). If the new feature is a simple property foo you'll just need a
method
on the adapter called fooChanged(). Adapter interfaces are in the
package
org.eclipse.dali.core.adapters. We currently support the java
implementation of the adapers. We also have support in the code for xml,
but this doesn't do much yet.
3. Create a constructor for the emf generated impl class that takes the
appropriate adapter (if you're creating a new impl class and not just
adding
a feature to an existing one). Update DaliFactory with a new create
method
that takes the adapter.
4. Update the emf generated impl class to call the adapter interface in
the setter method for the new property. Using emf you'll want to create
a
new method called setFoo(), rename the generated method to setFooGen().
Call setFooGen() from setFoo() before calling the adapter fooChanged()
method.
5. Update the Java adapter implementation. This is where the code goes
to update the java model when persistence model changes occur and vice
versa.
a. Implement the fooChanged() method by updating the java code first
checking if a change really occurred. EMF forwards event notification
even
if no change occurs, so we've had problems getting in infinite loops.
b. Go to the updatePersModel(CompilationUnit) method (or implement this
if this is a new adapter class). This method will be called if there
were
changes in the java model that affected this particular class. This is
based on a jdt JavaElementChangeListener that is added in
JavaPersistenceFileModelAdapter (this will be moving to only have one
listener per project instead of one listener per file).
c. There are a few helper classes for doing simple property annotation
updating (String, int, boolean, enums) See the
AbstractAnnotationElementAdapter hierarchy (this name will probably
change,
these aren't really adapters)
6. Add the appropriate widgets in the UI using the edit layer to update
to/from the model
I hope this helps get people started with adding new annotation/xml
features. Feel free to add to this list if you find something I've
missed.
We should also put this on the wiki at some point since it is information
that will change and be of interest to extenders. Feel free to make
suggestions about this process. Having new people adding features might
help uncover clearer, more efficient ways of doing this work.
Thanks,
Karen
--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
max@xxxxxxxxxxxxx
http://hibernate.org
JBoss Inc
max.andersen@xxxxxxxxx