db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: Argument Cosntructor not used anymore ?
Date Thu, 03 Apr 2003 18:04:12 GMT
Hi Leandro,

Leandro Rodrigo Saad Cruz wrote:
> I think we should provide this functionality (using user defined
> constructors) to help the developer enforce business rules.
> 
> Supose a User should be part of a Domain. The best way to enforce this
> constrain is using a pulic constructor
> 
> public User(int domain_id)
> {
> 
> }

We already have an optional attribute "initialization-method" on the 
class-descriptor level.
The optional initialization-method specifies a no-argument instance 
method that is invoked after reading an instnace from a database row. It 
can be used to do initialization and validations.

IMO it will sufficient to use a defult constructor + user defined 
initialization-method to all things needed.

> 
> May I work on this ??

Off course having an additional optional user defined constructer, or 
allow user defined factory methods won't do much harm. (apart from 
bloating our code base...)
If you want to work on this topic please try to provide a mechanisms 
that unifies the existing and the additional solutions.

cheers,
Thomas

> 
> On Thu, 2003-04-03 at 04:20, Mahler Thomas wrote:
> 
>>No, I think it's not longer used. a no argument constructor is sufficient.
>>
>>
>>>-----Original Message-----
>>>From: Leandro Rodrigo Saad Cruz [mailto:leandro@ibnetwork.com.br]
>>>Sent: Thursday, April 03, 2003 5:01 AM
>>>To: OJB Dev "Mailing List (E-mail)
>>>Subject: Argument Cosntructor not used anymore ?
>>>
>>>
>>>Are we still using multi-argument constructors to build objects on
>>>RowReaderDefaultImpl ?
>>>Why ?
>>>
>>>-- 
>>>Leandro Rodrigo Saad Cruz
>>>IT - Inter Business Tecnologia e Servicos (IB)
>>>http://www.ibnetwork.com.br
>>>http://jakarta.apache.org/ojb
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>


Mime
View raw message