[Fuge-devel] FUGE, FlowCyt

2 views
Skip to first unread message

Simon Schafferer

unread,
Aug 5, 2009, 10:47:08 AM8/5/09
to fuge-...@lists.sourceforge.net, Benjamin Weidenholzer
Hi,

is there a possibility to extend the hibernate-STK with the FuGEFlow.mdzip?
By now I imported the SNAPSHOT jars (hibernate-core, hibernate-common...) generated by maven in my Eclipse workspace, because I am currently developing a web application for flow cytometry analyisis with wicket and hibernate as persistence layer.

So I installed the fuge-hibernate-stk and everything worked fine. Then I tried to integrate FuGEFlow:

1. I downloaded FuGE-v1-profile.mdzip and FuGEFlow.mdzip from http://flowcyt.svn.sourceforge.net/viewvc/flowcyt/FuGEFlow/model/
2. I exported FuGEFlow.mdzip as EMF UML2(v1.x) XMI in MagicDraw 15.0 into fuge-hibernate-mda/src/main/uml
3. I changed the path in the fuge-hibernate-mda/pom.xml to FuGEFlow.uml2
4. mvn clean and afterwards mvn install

An error in the validation of the andromda model occured, you can find the log file in the attachment.

Do you suggest any other solution?

Is it possible for example, to generate Java Classes plus the hibernate configuration and mapping files from the FlowCyt XML schema files with hyperJaxB?

Kind regards,
Simon

andromda.1.log

Josef Spidlen

unread,
Aug 5, 2009, 3:17:15 PM8/5/09
to Simon Schafferer, fuge-...@lists.sourceforge.net, FlowCyt FuGE, Benjamin Weidenholzer
Hi Simon,

Based on your log file, it seems that there is only one error being repeated 30 times: One-to-one associations must have one side of the association indicating aggregation (aggregation defines the parent/owning entity). In the model, not all 1-1 associations are aggregations since "aggregations" do not really express the type of these relations (i.e, they are one "part of the other").
This wasn't a problem for us in order to derive the XML schema; however, I guess it should be technically possible to twist the model a bit, add change the associations to aggregations and try again.

In theory, I think hyperjaxb should work; however, it may require some tweaking as well. Specifically, it is relatively straightforward to to generate FuGEFlow java classes and the persistence configuration; however, using the default settings, you will probably encounter a few foreign key circularity dependencies that you will have to fight.

Not sure if the FuGE core developers have some better ideas?

Cheers,
Josef
-- 
Josef Spidlen, Ph.D.
Terry Fox Laboratory, BC Cancer Agency
675 West 10th Avenue, V5Z 1L3 Vancouver, BC, Canada
 
Tel: +1 (604) 675-8000 x 7755
http://www.terryfoxlab.ca/people/rbrinkman/josef.aspx

Allyson Lister

unread,
Aug 6, 2009, 3:22:10 AM8/6/09
to fuge-...@lists.sourceforge.net, Simon Schafferer, FlowCyt FuGE, Benjamin Weidenholzer
Hi all,

Firstly, glad to hear that you're using the STKs, and that you successfully built the hibernate STK using the FuGE UML file. It seems that most of the FlowCyt people have just used the XSD STK so far, and therefore haven't run into the problems you're experiencing. I should say that I helped develop the FuGE STKs, and don't have any experience on the FlowCyt UML (other than as an extension of FuGE), so please take these comments in that context.

I agree with Josef - it seems to be something about the FlowCyt UML itself that is causing problems when you are trying to build using the hibernate STK rather than just the XSD STK. As Josef says, if you open up the FlowCyt UML in MagicDraw, and go through each of the listed associations in the error file and choose one end of each association to be the aggregation. Unless the FlowCyt people are planning to do it themselves?

Short answer for hyperjaxb: yes, it should be possible.

Back when we were developing the FuGE hibernate STK, we did look at hyperjaxb. Specifically, at one of the FuGE workshops there was some discussion about it (you can see my blog post on that workshop here: http://themindwobbles.wordpress.com/2007/12/14/fuge-users-workshop-13-14-december-2007/ just search in that post for "hyperjaxb3"). There, we said that there is a possibility that we could get hyperjaxb3 to work for this (I had tried with an earlier version of hyperjaxb but it didn't work properly). Hyperjaxb3 generates both Entity POJO's and the jaxb2 classes. So, in theory you could only use the Andromda XSD cartridge (i.e. just the FuGE XSD STK) and then combine that with the use of hyperjaxb3 for the rest. However, then you loose all the information that is present in the UML but not in the XSD, which is a bit of a problem. However, on the plus side, hyperjaxb3 uses both hibernate and ejb3 natively (you can choose). Leandro wants to work on a merged persistence/hyperjaxb3 extended cartridge, or perhaps its own cartridge. So perhaps the generation of a hyperjaxb3 cartridge would be a suitable long-term goal.

I haven't heard from Leandro as to whether or not he made any further progress with the developing this particular AndroMDA cartridge - perhaps he'll be able to give us his thoughts?

In summary, you may wish to try to use hyperjaxb in conjunction with the XSD STK, but it isn't really suitable for use with the hibernate STK. This means two choices: 1) use the hibernate STK on its own. Pros: it's all in the one project; people have successfully used it and are using it for the FuGE UML. Cons: that there is a disconnect between the XML JAXB classes and the hibernate classes, or 2) use the XSD STK and hyperjaxb3 based on the resulting XSD. Pros: no disconnect between jaxb classes and hibernate classes. Cons: you'd be the first to try it out, and it means two separate stages to the project. The third option, the use of a hyperjaxb2 AndroMDA cartridge would be best, but probably isn't finished yet.

Hope this helps!

Thanks,
Allyson

2009/8/5 Josef Spidlen <jspi...@bccrc.ca>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fuge-devel mailing list
Fuge-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fuge-devel




--
Allyson Lister
http://themindwobbles.wordpress.com

CISBAN, http://www.cisban.ac.uk
Newcastle University

Jones, Andy

unread,
Aug 6, 2009, 4:30:15 AM8/6/09
to fuge-...@lists.sourceforge.net

Hi Simon,

I didn’t have a chance to look through your log file yet but based on Josef’s answer I think I can respond. I recall when developing the FuGE hibernate STK there was a problem with 1:1 associations that were not composite or aggregate (closed or open diamonds), because the processing software did not know in which direction to build the association (for foreign keys for the SQL perhaps) - even though the arrow should give this away. I think my solution was to add aggregations (open diamond) on the non-arrow end of the association, since these don’t affect the generation of anything else. I’m sure there will be other work-arounds if you don’t want to alter the UML,

Cheers

Andy

Reply all
Reply to author
Forward
0 new messages