|
From: | Jong-Hyouk Yun |
Subject: | Re: [Chicken-users] Factory pattern |
Date: | Sun, 24 Jun 2007 14:13:47 +0900 |
Hi folks,
I'm new to tinyclos. I've been playing a bit with it and there is something that still annoys me. All the examples I've seen uses the initialize generic with initargs (usually in combination with the convenient initialize-slots) to initialize instances. Well, I felt that initialize-slots is there just because working with a plain list of args is not too comfortable for a constructor, so in practice initialize is more or less confined to work as a slot initializer. But then I think that this kind of constructor exposes every slot to the client, which is all against encapsulation. This can be solved easily defining different factory procedures, which encapsulate the call to make themselves. But I can't find code or advices regarding the use of this pattern with tinyclos. Is this common practice? Is there another recommended way to define proper constructors on top of make+initialize that encapsulate instance initialization?
Thank you in advance.
Cheers,
Carlos
_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users
[Prev in Thread] | Current Thread | [Next in Thread] |