12 Jun 2005 12:02
Re: Model Driven Architecture
Per Nyfelt <per_nyfelt <at> users.sourceforge.net>
2005-06-12 10:02:43 GMT
2005-06-12 10:02:43 GMT
Hi,
Here's some feedback:
1. It would be easier to follow your thoughts if you provided a Junit test or
two instead of "just a bunch of classes".
2. It does not compile :( (wrong return type in BankImpl.getBankAccounts(),
BankAccoutnImpl.ocd is not valid XML etc.)
3. You use "this" a lot. Use of this might get you into problems. Consider
self() as an alternative. self() will give you a proxy reference back rather
than the "raw" object.
4. If you Maps and Sets contains Ozone Objects it is not too bad but are
scalable only up to a certain point (when the number of proxies that are
stored in the Set becomes so many that memory is filled up). In that case you
need a lazy loading collection. Look at the Collections module for this.
Basically it goes like this:
* Normal Objects in java.util collections -> OK for very few, serializable and
small objects
* Ozone Objects in java.util collections -> OK for collections with a couple
of hundred or perhaps a couple of thousand items
* Normal Objects in org.ozoneDB collections -> OK for many, serializable and
small objects
* Ozone Objects in org.ozoneDB collections -> OK for large collections with
hundreds of thousands of items
5. Human does not extend OzoneRemote but HumanImpl extends OzoneObject. Same
thing with Employment, Company and BankAccount.
Best regards,
Per
Saturday 11 June 2005 13.49 skrev Karl Wettin:
> Hello list,
>
> it's been a year and half since my last try, so I thought it was about
> time to give it another try: I want to add Ozone support to my MDA-tool
> Silvertejp. It creates java code based on UML class diagrams. It already
> support various POJO variants, Hibernate (ORM) and Compass (OSEM).
>
> I've made an example diagram that use most of the supported elements,
>
> > #load upl/java.upl
> > #default class stereotype <<bound ozone>>
> > #default package se.snigel.ozone
> >
> > [ /Human/
> > name:String
> > birth:Date
> > death:Date
> > abstract +getChildren():Set
> > ]<|--+----[Man]-- {1} +father +child {0..*} --[Human]
> > +--[Woman]-- {1} +mother +child {0..*} --[Human]
> >
> > [Company]<|--[Bank](accountNumber:String)<#>--- {0..1} -[BankAccount]
> >
> >
> > [BankAccount
> > +accountNumber:String
> > +balance:float
> > ]- {0..*} ---[Human]
> >
> >
> > [Company]- {0..*} +employer | +employee {0..*} -[Human]
> >
> > \--[Employment
> > +salary:float
> > ]-- +depositBankAccount ->[BankAccount]
>
> and manually wrote the code that would be created by above diagram:
>
> <http://wiki.snigel.net/se_2esnigel_2esilvertejp?action=AttachFile&do=g
> et&target=human_ozone.tar.gz>
>
>
> It would be great if someone could take a look at that code and tell me
> if I do something strange. I know for sure that my non Ozone-aware Set:s
> and Map:s are bad. There is no setter, just getter. What superclass
> should I extend rather than java.util?
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
RSS Feed