anonymous wrote : No matter if we use a custom classloader we would need to 
have a *very* stable API to do this since we would compile against liet say 
Smooks 1.0 would our code be able to use Smooks 1.1, 1.2 etc. without updating 
the binaries ? - does Smooks provide that ? 

I believe you need to implement a strategy pattern that can handle every 
supported Smooks version. For example something like this:

 - SmooksReaderStrategy interface
   - Smooks1_0ReaderStrategy class
   - Smooks1_1ReaderStrategy class

Every one of those implementations knows how to use one specific version of 
Smooks. So they also have dependencies on that specific version. That is why 
you can't build against only one version of Smooks, you need to build against 
all of them. Because you can't do that within one bundle, you need to split it 
up in multiple bundles. The parts of the Smooks editor could then look 
something like this:

 - SmookEditor
 - SmooksReader API
 - Smooks1_0Reader implementation 
 - Smooks1_1Reader implementation

If I understand OSGI correctly then you wouldn't even need to worry to much 
about classloading, because every bundle can have it's own independent bundle 
dependencies. The SmooksEditor would have dependencies on the SmooksReader API 
and all it's implementations. Every implementation would a dependency on one 
specific version of Smooks.

You could even make every reader a separate Eclipse plugin. That way you could 
implement new Readers for new versions of Smooks and use them with older 
versions of the editor. You only need to install the plugin.

anonymous wrote : And what about the model that we load - is that stable ? I'm 
asking since I don't know :) 

The model that the Smooks editor gets from the Readers wouldn't change in 
between Smooks editors because they would belong to SmooksReader API. The 
Reader implementations would take care of the proper translation between the 
model that Smooks uses and the model that the Editor uses. 

anonymous wrote : About partial documents then users don't have syntax correct 
files - they type and it will be imperfect. That would mean as soon as the user 
type the graphical editor would not be able to show anything - that might be ok 
as you write it. 

Yeah, you would have that same problem with the current Smooks editor. The 
editor would need to tell the user that the source model can't be read because 
of a syntax problem.

anonymous wrote : Another issue is that Smooks might not be able to load any of 
the related classes referred to in the editor because the classes are not 
compiled yet - does it support that ?

No, Smooks doesn't currently support that. In this special case we would need a 
special reader. Maybe we can reuse the code that is now used by the editor to 
read the java model?

I think that the Smooks team would be happy to provide support for implementing 
any special readers like that special Java reader or a XSD reader. I know I 
would at least ;).

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4217296#4217296

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217296
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to