-
1. Re: Core Concepts - s-ramp + modeshape (division of labor)
objectiser Aug 29, 2012 9:12 AM (in response to eric.wittmann)Hi Eric
I think as part of the initial prototyping work, to help get things up and running, having the s-ramp aspects in ModeShape may have been for expediency - especially since the s-ramp project has only recently been started as a standalone project.
However longer term I think it makes sense that all s-ramp related capabilities should be in the separate project, so that ModeShape is domain independent.
Regards
Gary
-
2. Re: Core Concepts - s-ramp + modeshape (division of labor)
kurtstam Aug 29, 2012 11:31 AM (in response to eric.wittmann)Hi Eric,
Randall had already implemented the JCR model for S-RAMP, and I just started using it. I don't think there is an issue with us deploying an updated S-RAMP jcr model to Modeshape if we need to. I think the sticking point is 'extending the sequencers'. They are a bit like stored procedures in a database. It has some advantages to have modeshape do the sequencing (faster and you can't bypass it), but it makes us dependent on the modeshape release cycle in a way unless we can extend or maintain. I think Randall has been thinking about making them more pluggable. Hopefully he can shine some light on this.
--Kurt
-
3. Re: Core Concepts - s-ramp + modeshape (division of labor)
eric.wittmann Aug 29, 2012 11:43 AM (in response to kurtstam)I agree that the sticking point is 'extending the sequencers'. If we want to pull the s-ramp stuff out of ModeShape, then the easiest thing to do would probably be to refactor the existing sequencers a bit so they can be extended by s-ramp. So there would be an SrampXsdSequencer (for example) that extended the XsdSequencer class provided by ModeShape. The alternative seems harder: change ModeShape to support a sequencer chain to give multiple sequencers a crack at the content.
-
4. Re: Core Concepts - s-ramp + modeshape (division of labor)
rhauch Aug 30, 2012 8:43 AM (in response to eric.wittmann)First, a little background.
ModeShape has had the notion of sequencers since the project's inception, and we wanted XSD and WSDL sequencers (among others) to extract the useful bits for data service functionality. However, before we implemented these two sequencers, I became aware of the S-RAMP effort, which conveniently defined an "object model" for both XSD and WSDL. We simply incorporated these object models into JCR node types. Other than this, there is nothing "S-RAMP-specific or -aware" in ModeShape.
If these sequencers are not compatible with the S-RAMP implementations needs, please let us know so that we can either change them. Of course, it's always possible for the S-RAMP implementation to own its own XSD and WSDL sequencers, though I think that just kicks the can down the road, since ModeShape users that want the S-RAMP sequencers would then have to wait for an S-RAMP release. :-)
And anyone can implement their own sequencers and plug them into ModeShape. With 3, we've changed the sequencer API to make it far easier to write one - it largely is just implementing an interface and using the JCR API.
Secondly, ModeShape's sequencers are already pluggable. The S-RAMP implementation can provide its own sequencers. And with ModeShape 3, we've tried to make it far easier to implement your own custom sequencers (implement an interface, use custom logic to read the content, and use the JCR API to generate the node structure). Plus, with ModeShape 3, you can manually call the sequencers from client code - if this is important, please try it and give us feedback as soon as possible so that we can make alterations to the API before 3.0.0.Final.
If we want to pull the s-ramp stuff out of ModeShape, then the easiest thing to do would probably be to refactor the existing sequencers a bit so they can be extended by s-ramp. So there would be an SrampXsdSequencer (for example) that extended the XsdSequencer class provided by ModeShape.
This should be easy to do. Once again, we're happy to make changes to these sequencer to make them more reusable by S-RAMP, so please let us know what they need to be. Feel free to fork the ModeShape Git repository and submit pull-requests, too.
... but it makes us dependent on the modeshape release cycle in a way unless we can extend or maintain.
This is true of any library that you want to reuse. As always, there are pros/cons for reuse vs. reimplement. And I know what it's like to wait for a release that has fixes/changes you need, and it does make things very difficult. We've been waiting for an AS7.2 release for months.
I will say this, tho: we're currently on 3-week release cycles for ModeShape 3 betas, and plan to move to 4-6 week timebox (minor) releases after ModeShape 3.0.0.Final is out. If you have any concern about our schedule, please let us know.
-
5. Re: Core Concepts - s-ramp + modeshape (division of labor)
eric.wittmann Aug 30, 2012 10:19 AM (in response to rhauch)Thanks for the reply. I'll respond and then propose:
We simply incorporated these object models into JCR node types. Other than this, there is nothing "S-RAMP-specific or -aware" in ModeShape.
The modeshape-sequencer-sramp module has some base classes and the sramp.cnd file. The sequencers themselves (XSD, WSDL, etc) extend the classes in the sramp module. In practice, the sequencers add a couple of sramp-specific properties (sramp:contentType and sramp:contentSize) but they don't really do anything else sramp-y. For example, the sequencers don't add any of the nodetypes.
For the record, I think what it's doing now is great. I propose we do this:
- Get rid of the sramp module in ModeShape and move any of the common base classes found in there to some other module (perhaps the XML sequencer project becomes the base for the XSD and WSDL ones)
- Keep the XSD and WSDL sequencers in ModeShape
- Move the sramp.cnd out of ModeShape and into S-RAMP
- Refactor the ModeShape XSD and WSDL sequencers a bit so that S-RAMP can extend them
- Implement XSD and WSDL sequencers in S-RAMP that extend the XSD and WSDL sequencers that come with ModeShape (the S-RAMP ones would add S-RAMP node types and properties)
Basically I think we want to subclass the sequencers in S-RAMP just so we can add the S-RAMP specific properties and node types to the derived nodes. We can make it a separate project in the S-RAMP codebase in case users want S-RAMP sequencers without actually using S-RAMP (not sure what the use case for that would be).
I'm happy to do this work if you agree it's the right approach. I'll fork ModeShape and submit a pull request when it's ready.
This is true of any library that you want to reuse. As always, there are pros/cons for reuse vs. reimplement. And I know what it's like to wait for a release that has fixes/changes you need, and it does make things very difficult. We've been waiting for an AS7.2 release for months.
I will say this, tho: we're currently on 3-week release cycles for ModeShape 3 betas, and plan to move to 4-6 week timebox (minor) releases after ModeShape 3.0.0.Final is out. If you have any concern about our schedule, please let us know.
You're right, certainly. And I don't think waiting on ModeShape releases would, in practice, be a problem.
-
6. Re: Core Concepts - s-ramp + modeshape (division of labor)
rhauch Aug 30, 2012 10:55 AM (in response to eric.wittmann)For example, the sequencers don't add any of the nodetypes.
They do, actually. See the XsdSequencer.initialize(...) and XmlSequencer.initialize(...) methods for two examples.
- Get rid of the sramp module in ModeShape and move any of the common base classes found in there to some other module (perhaps the XML sequencer project becomes the base for the XSD and WSDL ones)
Or rename the current 'modeshape-sequencer-sramp' module and packages? Is the use of "SRAMP" the problem, cause that's easily remedied. Please open an issue and we'll address. Note that the XSD and WSDL sequencers do not currently extend the XML sequencer (there's no point, since they all use their own parser mechanism).
- Keep the XSD and WSDL sequencers in ModeShape
- Move the sramp.cnd out of ModeShape and into S-RAMP
Removing the 'sramp.cnd' from ModeShape would be difficult, since it's required (and used) by the XSD and WSDL sequencers during initialization. Note the XML sequencer doesn't use the 'sramp.cnd' node types. Note that the "sramp.cnd" file is in the "org.modeshape.sequencer.sramp" package/namespace, so it's only used to register node types if the XSD or WSDL sequencers are configured.
- Refactor the ModeShape XSD and WSDL sequencers a bit so that S-RAMP can extend them
- Implement XSD and WSDL sequencers in S-RAMP that extend the XSD and WSDL sequencers that come with ModeShape (the S-RAMP ones would add S-RAMP node types and properties)
We certainly can refactor these sequencers so that you can extend them. But we can't remove the node types or make these generic without completely sacrificing the functionality. If you don't like the node types in the "sramp.cnd", then we can change them (obviously my preference) or you can choose to implement your own sequencers with your own node types and simply not use the ModeShape sequencers.
Basically I think we want to subclass the sequencers in S-RAMP just so we can add the S-RAMP specific properties and node types to the derived nodes. We can make it a separate project in the S-RAMP codebase in case users want S-RAMP sequencers without actually using S-RAMP (not sure what the use case for that would be).
I'm happy to do this work if you agree it's the right approach. I'll fork ModeShape and submit a pull request when it's ready.
That sounds great, actually! Please create a JIRA issue first, with a summary of the intended changes (re my concerns above).
-
7. Re: Core Concepts - s-ramp + modeshape (division of labor)
eric.wittmann Aug 30, 2012 11:20 AM (in response to rhauch)You're right - I had to dive in a little deeper to get a beter understanding of what's going on. What I didn't realize is that the xsd.cnd basically extends the sramp.cnd. I guess what I was proposing was to invert (logically) that relationship, so that sramp.cnd sat on top of xsd.cnd. However, I see why that's difficult now.
I really am trying to figure out what's the Right Thing.
I think the choices are:
1) The ModeShape sequencers for XML, XSD, WSDL, Policy, etc are all fully S-RAMP aware.
2) The XML, XSD, WSDL, etc sequencers know nothing about S-RAMP but are extended to add these features
If we stick with #1 then I think S-RAMP developers would help out on the impl and contribute that code directly to ModeShape.
If we do #2 then I think there's a small amount of refactoring in the sequencers and then they are extended in an s-ramp project.
I think, at this point, I'm happy to do either of these. But I'm still not sure which one is best...
-
8. Re: Core Concepts - s-ramp + modeshape (division of labor)
rhauch Aug 30, 2012 2:43 PM (in response to eric.wittmann)I really am trying to figure out what's the Right Thing.
Understood. Me, too.
I think the choices are:
1) The ModeShape sequencers for XML, XSD, WSDL, Policy, etc are all fully S-RAMP aware.
2) The XML, XSD, WSDL, etc sequencers know nothing about S-RAMP but are extended to add these features
If we stick with #1 then I think S-RAMP developers would help out on the impl and contribute that code directly to ModeShape.
If we do #2 then I think there's a small amount of refactoring in the sequencers and then they are extended in an s-ramp project.
I think, at this point, I'm happy to do either of these. But I'm still not sure which one is best...
Remember that the S-RAMP implementation will not be the only thing that relies upon the XML, XSD, and WSDL sequencers. The advantage of #1 is that the derived output of the sequencers is always the same, whereas with #2 it will be different in ModeShape/EDS versus S-RAMP.
As for #1, we absolutely would welcome any help, and are very open to change the sequencers (and the structure of their derived output) so that they work correctly for S-RAMP's needs.
And if #1 is chosen, then let's start by creating issues in ModeShape's JIRA -- perhaps one each for enhancing/improving/correcting the XSD, XML and WSDL sequencers (or a single one for all three; not sure it matters to me). Then on those issues we can start identifying and educating us about what needs to change, and you can link any pull-requests with proposed changes.
-
9. Re: Core Concepts - s-ramp + modeshape (division of labor)
kurtstam Aug 31, 2012 9:28 AM (in response to rhauch)If someone wants to use their JCR implementation rather then ModeShape, we said before you could do this, but you'd still have to run modeshape on the side so the sequencers can do their job. Does choice 2 make it easier to run with your own JCR implementation?
-
10. Re: Core Concepts - s-ramp + modeshape (division of labor)
rhauch Aug 31, 2012 9:35 AM (in response to kurtstam)If someone wants to use their JCR implementation rather then ModeShape, we said before you could do this, but you'd still have to run modeshape on the side so the sequencers can do their job. Does choice 2 make it easier to run with your own JCR implementation?
Honestly, I don't think it matters one way or the other. Running sequencers with other JCR implementations will require a bit of work on ModeShape's part. (Right now, the sequencers are passed ModeShape-specific interfaces, but that's fixable. Want to log an issue?).
Option 2 implies that the S-RAMP custom sequencers extend/reuse ModeShape's sequencers, so S-RAMP will continue to have a dependency on ModeShape libraries (but no need to rely upon the JCR feature). And S-RAMP will have access to all of it's custom sequencers plus those in the ModeShape sequencer JARs.