On 28 Nov 2011, at 17:46, Lars Balker Rasmussen wrote:

> No, what you want is an abstraction.
> 
> Basically you're trying to hack in something that's actually 
> business-information connecting several objects.
> 
> In relational databases, you know it'd be wrong to do something like this in 
> the employee table; the principle is much the same here.

yep

> Maybe add an extra class WorksFor[1] containing the cost and department, and 
> have a list of WorksFor in employee. (Warning, very little thought went into 
> this and all my brain-blood is occupied around full stomach, but it solves 
> the basic problem :) )

that's what I was afraid for. This creates a lot of overhead by creating all 
the necessary objects.
I implemented it using a EmployeeDepartment class as would be the case when 
using RDBS. It works well, but I hope the app won't get too slow because of 
this...

I just hoped Moose would have some kind of magic allowing to have objects as 
hash keys...

best and thank you all for the help!

--
erik

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to