I agree there would seldom be "math" operations, but surely there
will be comparisons (division = 1). Can this be written division.intValue()
= 1?
sure, which is of course why I suggested the "always use objects for key
values", or
at least "always use objects for values you wish to have nullable".

However, for non-pk fields, there is much more argument for the store as
object type
but expose as primitive - again, legacy db with null columns but object
model with
primitive properties.

I guess I was reacting to "They are not supposed to have any business
meaning" - 
sorry about that.

Russell

> -----Original Message-----
> From: John McNally [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 4:07 PM
> To: Turbine Torque Developers List
> Subject: RE: problems after Key->type change (TRQ41)
> 
> 
> I know there are many cases where a business object is used as a pk. 
> But why is there the need to use primitives to model these.  
> What is the
> "use case"?  I think of something like this:
> 
> class Department
> {
> Division getDivision()
> {
>     divisionId = getDeptId() % 100; // getDeptId() returns an int
>     return DivisionManager.getInstance(divisionId);
> }
> }
> 
> And if there is actually some case where such operations are required
> are they so often that substituting getDeptId().intValue() would be a
> problem?
> 
> john mcnally
> 
> On Fri, 2002-10-11 at 10:50, Russell Smyth wrote:
> > 
> > 
> > 
> > > I'm confused as to why people need primitive representations 
> > > of pk's, I
> > > can't think of any math one would want to do with them.  
> They are not
> > > supposed to have any business meaning.
> > 
> > Because some of us have to use (legacy) databases defined 
> by others who
> > do not necessarily agree with your concept of PK's not 
> having any business
> > meaning.
> > 
> > Besides which, I am not sure I agree with pk fields having 
> no business
> > meaning..
> > many of our tables have pk fields which are our department 
> or devision
> > number - 
> > these obviously have business meaning, and are a necessary 
> part of the pks!
> > 
> > Russell
> > 
> > --
> > To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to