[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [wtp-incubator-dev] EMF2DOMSSE
|
Konstantin Komissarchik wrote:
I would be interested in hearing more about implementing the wrapper solution using EMF. Do you end up letting EMF generate the model and then hand-replacing the implementations of various methods with calls to DOM?
Yes and no. The approach that the XSD EMF model takes is the have a
place holder field for the DOM related element that it corresponds to.
I.e. if an an EMF Class is an element, it holds an org.w3c.dom.Element
field that gets populated. If you have a an EMF class that would map to
an attribute, then it has an org.w3c.dom.Attribute field. When ever a
set or update is called on the EMF model it fires off an an ENotifier
event to do any correspond synchronization. At least that is my
understanding so far. The root element in Emf gets the
org.w3c.dom.Document field.
So you can load up and create the entire EMF model by setting
emfRootElementClass.setDocument(document) which would take the WTP DOM
as the document to be set, and the necessary objects are created for the
rest of the model.
I'm still going through the code, but it allows for using EMF to model
and generate the code, and then adding the necessary synchronization
code with out having to use Adapters.