For Programmers: Free Programming Magazines  


Home > Archive > Ruby > August 2005 > Re: Circular dependecy on classes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Circular dependecy on classes
Robert Klemme

2005-08-28, 6:59 pm

2005/8/26, Derek Wyatt <derek@derekwyatt.org>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>=20
>=20
> I think you're simply using an instance variable where a method is
> what you want. Take advantage of the runtime compile/binding that
> you're currently having problems with. Do this instead:
>=20
> class Solder
> ~ def can_upgrade_to
> ~ [Knight]
> ~ end
> end
>=20
> And your problems go away. You don't have to open it up later. If
> you want it private, you can simply make it private.


Doesn't solve the OP'S problem because it was about dependencies:
Knight has to be defined when it is used.

Kind regards

robert


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com