You can start off by looking at "Dynamic Value Object" pattern on
theserverside:

http://www2.theserverside.com/patterns/thread.jsp?thread_id=2722


Note this is model is NOT truly dynamic field instantiation;  it uses
dynamic proxies to generate "value-stubs" that can dynamically implement any
interface at runtime, but it still requires defined interfaces at compile
time.

However you can use this pattern as a model to generate truely dynamic
value-containers which implement abstract interfaces, as I have described
below.

To interface this with the db using BMP, you will need to create your own
DataManager, a la CMP 2.0.  This requires a strong grasp of data abstraction
and SQL mapping architecture.  For example we had to create
SQLExpressionBuilders that can handle any combination of sql statements,
even complex and recursive joins.

Dynamic modification of bean metadata is NOT a simple architecture to
implement.  You need to ask yourself thoroughly:  "Do I Need It?" (a la XP!
:-)) before going down this path.

Gene


-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of PiFen Ellwood
Sent: Tuesday, April 24, 2001 5:47 AM
To: [EMAIL PROTECTED]
Subject: Re: How to allow easy addition of fields to a bean.


Hi Gene,
Do you have any design pattern for such an
architecture? Or do you care to share your
architecture design on dynamically add or remove
fields to the entity beans?

Thanks
--- Gene Chuang <[EMAIL PROTECTED]> wrote:
> Current CMP specs do not allow dynamic modification
> of entity bean metadata
> (add/remove fields).  HOWEVER, you CAN mock this
> with BMP if you design your
> BMP beans well enough.  And obviously your bean
> interface will only have
> abstract getter/setter/finder
> (getValue/setValue/findValue) that takes
> parameterized constraints.  Once again this is
> do-able, but require some
> careful architecting.
>
> Alternatively you can just use solely session beans
> and value-objects;  this
> way you can change the metadata at any time.
>
> Gene
>
> -----Original Message-----
> From: A mailing list for Enterprise JavaBeans
> development
> [mailto:[EMAIL PROTECTED]]On Behalf Of S.
> von Knellehekje
> Sent: Monday, April 09, 2001 3:53 AM
> To: [EMAIL PROTECTED]
> Subject: How to allow easy addition of fields to a
> bean.
>
>
> 'Ello,
>
> I'm writing some support software and want to use
> EJB and a 3-tier model,
> because I think that the best option. I can't,
> however, figure out how to
> allow the users of the software to add fields to the
> beans in the datalayer
> without having them to rewrite my beans.
>
> My first guess was to use extension of my databeans
> but that means chancing
> the type of the variables used to store the home and
> remote interface's in
> my 2nd tier (or doesn't it?) and rewriting the home
> interface because of the
> return types of the create method and some of the
> findBy methods.
>
> I think this is quite a common problem, but I can't
> seem to find anything on
> how to solve it. Can anybody tell me how to tackle
> this or point me to some
> possible solutions / resources?
>
> Thanks a lot,
>
> Sandigo.
>
>
===========================================================================
> 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".
>
>
===========================================================================
> 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".
>


=====
PiFen Ellwood

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

===========================================================================
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".

===========================================================================
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".

Reply via email to