Discussion:
[Middlegen-user] ValueObject and Session Facade support
Jens Fischer
2003-04-23 16:13:11 UTC
Permalink
Hello Middlegen users,

for one of my computer science lectures I had the need to use Value
Objects instead of Data Objects and also needed a Session Facade
pattern on top of each CMP bean. Since Middlegen didn't support VOs
and the Xdoclet version of the <entityfacade/> pattern did neither I
had to find a workaround for this. So I modified some Middlegen
templates (which is way easier than fiddling with XDoclet templates,
by the way) to achieve my wanted results.

If anybody is interested in these hacks I welcome you to visit the
source code at
http://savannah.informatik.haw-hamburg.de/cvs/?group=fis.
Unfortunately the whole stuff is very weakly documented (and most of
it in german) and the modifications I made are pretty project-specifc,
but if you have the real need to use these features I'm sure you'll
find a way to use it. The development of this project is still
ongoing, so you can expect improvements on the code.

Anyways, feel free to send any feedback.

Jens
Rod Macpherson
2003-04-23 16:25:09 UTC
Permalink
I did the same thing. Generated my own VOs with a velocity script driven
from middlegen and modified the entity bean script to use the VO. For
example, ditch all of those ultra-long ejbCreate methods and replace
with a single ebjCreate taking a VO.

-----Original Message-----
From: Jens Fischer [mailto:***@microsoth.net]
Sent: Wednesday, April 23, 2003 11:13 AM
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] ValueObject and Session Facade support


Hello Middlegen users,

for one of my computer science lectures I had the need to use Value
Objects instead of Data Objects and also needed a Session Facade pattern
on top of each CMP bean. Since Middlegen didn't support VOs and the
Xdoclet version of the <entityfacade/> pattern did neither I had to find
a workaround for this. So I modified some Middlegen templates (which is
way easier than fiddling with XDoclet templates, by the way) to achieve
my wanted results.

If anybody is interested in these hacks I welcome you to visit the
source code at http://savannah.informatik.haw-hamburg.de/cvs/?group=fis.
Unfortunately the whole stuff is very weakly documented (and most of it
in german) and the modifications I made are pretty project-specifc, but
if you have the real need to use these features I'm sure you'll find a
way to use it. The development of this project is still ongoing, so you
can expect improvements on the code.

Anyways, feel free to send any feedback.

Jens



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Aslak Hellesoy
2003-04-23 17:54:06 UTC
Permalink
Thanks Jens,

There is already an SF issue for this, and I pasted your mail there for the
record.
http://sourceforge.net/tracker/index.php?func=detail&aid=636987&group_id=360
44&atid=415992

Aslak
Post by Rod Macpherson
-----Original Message-----
Fischer
Sent: 23. april 2003 20:13
Subject: [Middlegen-user] ValueObject and Session Facade support
Hello Middlegen users,
for one of my computer science lectures I had the need to use Value
Objects instead of Data Objects and also needed a Session Facade
pattern on top of each CMP bean. Since Middlegen didn't support VOs
and the Xdoclet version of the <entityfacade/> pattern did neither I
had to find a workaround for this. So I modified some Middlegen
templates (which is way easier than fiddling with XDoclet templates,
by the way) to achieve my wanted results.
If anybody is interested in these hacks I welcome you to visit the
source code at
http://savannah.informatik.haw-hamburg.de/cvs/?group=fis.
Unfortunately the whole stuff is very weakly documented (and most of
it in german) and the modifications I made are pretty project-specifc,
but if you have the real need to use these features I'm sure you'll
find a way to use it. The development of this project is still
ongoing, so you can expect improvements on the code.
Anyways, feel free to send any feedback.
Jens
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Aslak Hellesoy
2003-04-23 18:01:11 UTC
Permalink
Jens, your link is broken. Do you have one that works? Alternatively, attach
your code (preferrably as a diff) to the SF issue.

Aslak
Post by Rod Macpherson
-----Original Message-----
Hellesoy
Sent: 23. april 2003 21:54
Subject: RE: [Middlegen-user] ValueObject and Session Facade support
Thanks Jens,
There is already an SF issue for this, and I pasted your mail
there for the
record.
http://sourceforge.net/tracker/index.php?func=detail&aid=636987&gr
oup_id=360
44&atid=415992
Aslak
Post by Rod Macpherson
-----Original Message-----
Fischer
Sent: 23. april 2003 20:13
Subject: [Middlegen-user] ValueObject and Session Facade support
Hello Middlegen users,
for one of my computer science lectures I had the need to use Value
Objects instead of Data Objects and also needed a Session Facade
pattern on top of each CMP bean. Since Middlegen didn't support VOs
and the Xdoclet version of the <entityfacade/> pattern did neither I
had to find a workaround for this. So I modified some Middlegen
templates (which is way easier than fiddling with XDoclet templates,
by the way) to achieve my wanted results.
If anybody is interested in these hacks I welcome you to visit the
source code at
http://savannah.informatik.haw-hamburg.de/cvs/?group=fis.
Unfortunately the whole stuff is very weakly documented (and most of
it in german) and the modifications I made are pretty project-specifc,
but if you have the real need to use these features I'm sure you'll
find a way to use it. The development of this project is still
ongoing, so you can expect improvements on the code.
Anyways, feel free to send any feedback.
Jens
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Jens Fischer
2003-04-23 19:16:22 UTC
Permalink
Hello Aslak,
Post by Aslak Hellesoy
Jens, your link is broken. Do you have one that works? Alternatively, attach
your code (preferrably as a diff) to the SF issue.
I think the link got broken due to the trailing full stop behind it.
Try http://savannah.informatik.haw-hamburg.de/cvs/?group=fis without
any "." behind it, maybe that helps. Or maybe try the direkt link to
the ViewCVS:
http://savannah.informatik.haw-hamburg.de/viewcvs/viewcvs.cgi/fis/

I'm not sure if attaching the code is a good idea, since the link from
above is pointing to the CVS info page (along with anonymous access
info) for my project and it inlcudes a lot of files, from dependent jars
to a whole ant-based build system and a struts-based web app ontop. The
Middlegen-specific files are clattered throughout the CVS module, e.g.
fis/etc/middlegen.properties, fis/resources/middlegen/* and of course
fis/build.xml (middlegen.ejb target). For your convenience I'll post
the anonymous CVS data here, but be prepared for downloading about 5MB
of data with a clean checkout

cvs -d:pserver:***@savannah.informatik.haw-hamburg.de:/opt2/cvs/software/fis login

cvs -z3
Post by Aslak Hellesoy
Aslak
Hopefully I will be able to come up with a more organized patch/diff
to the standard middlegen CVS HEAD files, but unfortunately I
currently lack the time for this work. I would appreciate it if
somebody could help me with that issue.

Jens

Eivind Waaler
2003-04-23 18:23:05 UTC
Permalink
Hi, I'm currently working on implementing this patch for middlegen. I
appreciate all contributions to make my task easier :) I'll have a look at
your stuff asap.

An issue I've had, that I know has been discussed on the XDoclet
mailinglist is the Value Object reentrant problem:

http://www.mail-archive.com/xdoclet-***@lists.sourceforge.net/msg03339.html

The problem is that you get recursive calls between two objects or more
that form a circular relationship (for example a bidirectional m:n
relationship). As far as I can see, there are two possible solutions to
this:

1. Create LightValue Objects without relationships together with the
ordinary Value Objects, and make all relationships return LightValue
Objects. This will not allow for relations deeper than two levels.

2. Design the entity beans so that all relationships are uni
directional. I consider this close to impossible as you will loose many of
the benefits with relationships.

Maybe a combination of the two would be the best, so that one could use
the GUI or preferences to choose which side of a bi-directional
relationship would be returning the LightValue Object..?

Anyone of you guys come up with a more smooth solution? I'd like to hear
about it..

Regards
.eivind
Post by Jens Fischer
Hello Middlegen users,
for one of my computer science lectures I had the need to use Value
Objects instead of Data Objects and also needed a Session Facade
pattern on top of each CMP bean. Since Middlegen didn't support VOs
and the Xdoclet version of the <entityfacade/> pattern did neither I
had to find a workaround for this. So I modified some Middlegen
templates (which is way easier than fiddling with XDoclet templates,
by the way) to achieve my wanted results.
If anybody is interested in these hacks I welcome you to visit the
source code at
http://savannah.informatik.haw-hamburg.de/cvs/?group=fis.
Unfortunately the whole stuff is very weakly documented (and most of
it in german) and the modifications I made are pretty project-specifc,
but if you have the real need to use these features I'm sure you'll
find a way to use it. The development of this project is still
ongoing, so you can expect improvements on the code.
Anyways, feel free to send any feedback.
Jens
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
middlegen-user mailing list
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Loading...