[jboss-user] [JBoss Tools (users)] - Re: Feedback on the Smooks editor

max.andersen@jboss.com do-not-reply at jboss.com
Thu Mar 12 05:48:40 EDT 2009


Warning - I am a smooks noob, just have that in mind when reading my answers :)

"mzeijen" wrote : 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
  | 

Of course, the problem is just that the two models of Smooks 1_0 and Smooks 1_1 is vastly different so I'm not sure any strategy can be defined that would work. But of course if it is doable then sure.

anonymous wrote : 
  | Every one of those implementations knows how to use one specific version of Smooks. So they also have dependencies on that specific version. 
  | 

Of course they have an dependency to a specific version (or rather version range Smooks 1.1.x and 1.0.x) but that does not mean they have a compile nor runtime dependency on the Smooks binaries.

anonymous wrote : 
  | That is why you can't build against only one version of Smooks, you need to build against all of them. 
  | 

I develop an IDE that is compiled against Java 5 and it supports Java 1.1 to Java 6 without any build dependency to each specific version.

Same goes for our AS, jbpm, hibernate (to some extent), esb, jbossws annd other tooling. If we had to depend on *every* runtime version of these we would have a gigantic monster ;)

anonymous wrote : 
  | 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. 
  | 

Sure, but we would now be bundling how many versions of Smooks ?
What about smooks 1.0.1, 1.0.2, 1.1.0, 1.1.1 etc ?

anonymous wrote : 
  | 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.

which means if smooks 1.2 comes out we would need to redo/adjust the tooling before the tooling can read understand it even if the syntax is 90% the same ...

anonymous wrote : 
  | 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.
  | 

If we somehow can create  a model from the internal smooks model that is independent of it then I agree this could work - but users who have to have perfect syntactically correct files all the time.

anonymous wrote : 
  | 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. 
  | 

The Reader you mention in that paragraph is from Smooks or from the Smooks plugin ?

anonymous wrote : 
  | 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.
  | 

the current editor at least in theory can survive broken parts and still read the rest.

anonymous wrote : 
  | 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?
  | 

If we can pass in a strategy then sure.

anonymous wrote : 
  | 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 ;).

Great :)

p.s. I'll meet up with Dart who have been doing the smooks editor at EclipseCon in 2 weeks time where we will discuss this so keep the ideas flowing ;)

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

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4217349



More information about the jboss-user mailing list