Charles said:
For sheer object-oriented stubbornness I DO NOT want to pass the Division's
primary key to PolicyBean's ejbCreate... I want to pass the Division
itself......But it seems so data-centric rather than object oriented. Why
use EJBs in the first place if I have to relegate myself to non-object
oriented techniques?
Charles I feel the same. Thats why when I went looking for a coffee machine
I made sure to pick one that would add to the flavour of my roast instead of
taking away from it i.e. diluting it. I have spent alot of my time in
Holland and I prefer the coffee there than Ireland. Its all watery here
(Ireland) and not such a nice taste. I feel I am either drinking either a
strong tea or very weak coffee.
Getting to the technicals how does your coffee machine support beans that
reference another. Do you have to write some code in the ejbLoad and
ejbStore to get the container to make the reference persistent. What I like
about my coffee machine is that I can map a remote reference field to a
database field and it extracts the primary key from the reference when
storing and creates a reference to the bean when loading - no coding.
QUESTION: How many other containers support this? Is this support native
i.e. the container does it and not some expensive thrid party addin product?
I would like to be sure that I have some chance porting to another server if
I had to.
Another thing I like to see is keeping my finder methods OO like. Why should
I have to extract the primary key field before sending it to a finder
method. Consider the situation where you have a Company and ContactPerson
beans. The ContactPerson home has a finder called findByCompany. Is it not
the case that currently we are all creating a parameter list like
findByCompany(int cid). A int is not a company I want to pass a Company
reference and not some int value that has no type checking. Well my coffee
machine maker has been nice enough to provide me with a means to keep my
design the way I want it i.e. findByCompany(Company company). The finder
description looks like this:
<finder>
<method-signature>findByCompany(Company c)</method-signature>
<where-clause>company_id = :c[ejb/company]</where-clause>
</finder>
They did not even stop there:
<finder>
<method-signature>findByAddress(Address address)</method-signature>
<where-clause>
(:address.street1 IS NULL OR :address.street1 = street1) AND
(:address.street2 IS NULL OR :address.street2 = street2) AND
(:address.city IS NULL OR :address.city = city) AND
(:address.state IS NULL OR :address.state = state) AND
(:address.zip = 0 OR :address.zip = zip)
</where-clause>
</finder>
This beats sending over 5 parameters. QUESTION: Does anybody know if there
is a performance different between sending over N number of parameters over
a single object with N number of fields. The address above is a serializable
object can the finder uses the Java Beans "Design Pattern" i.e.
address.street1 => address.getStreet1(). I believe there is more coming with
the next minor release.
Before anyone starts screaming, please don't. I am starting this discussion
because the future release of the ejb spec is suppose to provide some finder
syntax. I want to provide some input into this process and I think it would
be best if everybody contributed posts showing how their container does it.
QUESTION: What do you love and hate about your servers finder syntax. What
limitations does it have? What would you like to see? Personally I cannot
understand some of the current syntax used by vendors. What where they
thinking about? Again system programmers bringing the implementation to the
users attention without consideration of how many users will have to use it.
These same guys are the ones who create those BEAutiful user interfaces that
we all love to use instead of using the console. Come on guys abit more
consideration really pays off even if it takes you another few days; think
about the amount of times we have to use it. I want flow in my work not
distraction and irritation. I love my current coffee machine because it give
me a great coffee but I would like to visit friends and have a good mug of
coffee without having to bring my machine with me.
So come one goes lets FIND the best syntax and improve our lot.
kind regards,
<no-coffee-no-workee>
William Louth
</no-coffee-no-workee>
> -----Original Message-----
> From: May Charles N [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, April 04, 2000 6:46 PM
> To: [EMAIL PROTECTED]
> Subject: ejbCreate parameters: not Serializable
>
> According to my reading, the parameters in an ejbCreate method must be
> "RMI
> ready", meaning they are either primitives, arrays of RMI-ready objects,
> implement java.io.Serializable, or implement java.rmi.Remote (for
> instance,
> another EJB Remote interface).
>
> I want an ejbCreate method which takes, among other things, an EJB Remote
> interface as an argument (to set up a required association for an entity
> bean). For example, a Division has a 1-to-many association with Policy.
> Then
> in the ejbCreate for PolicyBean, I want to pass an instance of a Division,
> along with the primary key data. For sheer object-oriented stubbornness I
> DO
> NOT want to pass the Division's primary key to PolicyBean's ejbCreate... I
> want to pass the Division itself. I want to leave it up to PolicyBean to
> extract the primary key from the Division and store it as an instance
> variable.
> Not only can I not get this to work, but I cannot find any examples of
> others doing this. It seems like all the examples I find either pass
> primary
> key data or pass a primary key itself (for the associated object) to
> ejbCreate when setting up an association. Yes, I could pass the primary
> key
> of the desired associated object rather than the handle of the object
> itself, and this works fine since the primary key implements Serializable.
> But it seems so data-centric rather than object oriented. Why use EJBs in
> the first place if I have to relegate myself to non-object oriented
> techniques? For this particular purpose I don't care about the implied
> callback to obtain the primary key to the associated class (which must
> then
> be stored as an instance variable, and of course could have been passed
> directly). I care that it seems like the callback SHOULD work and it
> doesn't. My environment is VisualAge 3.02 EE.
> Any helpful advice is appreciated.
>
> Charles May, Programmer/Analyst
> AFCO Credit Corp. - Pittsburgh Systems Group
> A Mellon Financial Company
>
> (The views represented in this message are my own, and do not necessarily
> represent the views of my employer).
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".