Re: hash of objects inside an instance

[email protected] (Erik Colson)
Newsgroups perl.moose
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 455 B)
-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJO1Cd/AAoJEIgjtVOAAL1G+bUIAICTYcMPP8/7BpHknO1ccElb
unYzGv/N1WWyPk5p/dL24G0/qPhKOWCGz4/wl4AkWb2dFdEnpV9VlwPmTDBYNxkD
bAyVmwXaJQN/ljZqp72aZZatsSWkLdXaStxoDw8/6zggfChzGSNUfOgTOEuyQ+FN
gcYEoGTQxRdGu7+q/Nl1OvGJ3rIT/WkfJRmTz42BdEPCN7fJEofb4WwFKXt37b3D
9x/y8VnNlO/QLN/lzDYloUyoMnDAcpsF5iFGXdJ8woHRrmiqXGvrL42RRWvimhE5
onwrKxtY5X/rI/uNMBp6oQrWAvPaAWCMH7n/t6tddK17EsLQyHZSMCNz3Jbb5bc=
=80wN
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.