Emmanuel Lecharny wrote:
Ole Ersoy wrote:
Hey Emmanuel,
hey OLE,
I'm not going to comment everything you wrote, just because I don't have
more than a 100 Kfeet vision of what EMF is and can do.
You think that EMF is the ultimate solution, but I don't have time to
read the thousands of pages I have found about EMF on the web.
Yeah - Some of the material can be simplified a great deal I think / broken
down into simpler use cases.
Here is what I suggest : can you just provide some working sample using
EMF ?
What we need is :
- a file will contain ADS configuration (server.xml)
For this we just need to grab the server.xml Schema and generate the
corresponding EMF beans from it. I can do this and check it into my sandbox.
Anyone have a quick link to the server.xml xsd schema?
- we should be able to read it easily on Studio (without writing a hand
crafted XML parser)
That's easy. In addition to generating a model, EMF can generate Eclipse
plugins, including an editor for the model, that Studio team could use the
editor plugin as an example for how to interact with the model. The generated
editor comes with undo,redo,save,etc. so most of the base functionality is
already there.
- we should be able to produce this same file on Studio
Also easy. Studio would just create a uninitialized instance of the model and
serialize it. This takes about 3 lines of code...I'll make sure to point them
out when it's done.
- we should be able to read this file in ADS, validating it and tells
explicitely where we have errors
I know this is what the EMF framework is for, so using it would be an added
plus for the Studio team I think. I'm not an expert on it, but I'll do my best
to find answers on how to better provide validation feedback whenever
encountered. The EMF ecore editor uses this extensively, and the feedback is
great. There are two tabs in the editor. If the parser encounters invalid
feedback, it displays it in the feedback tab.
- we should then be able to use the generated objects in a simple way
(for instance, int port = config.getServerPort(); or Interceptor
schemaInterceptor = config.getInterceptor( "schema" ); )
Yup - Works just like that. Also if you need a configuration object several layers
down in the containment hierarchy, you can use XPath expression...something like
resource.getObject("/rootElement/nextLevel/objectIwant);
Now I just have to find the server.xml schema. If anyone has a quick link to
it, that would be great.
Cheers,
- Ole