Hi,
I use an application that used to have a shared pool for varaibles for global parameters. I removed them and implemented a special class for parameters but I don't feel happy with that.
Is it a good practice to implement parameters as class side method on each relevant model class (instead of having a global container for parameters) ? If yes, I guess I need to use pragma or something else to get these parameters easily.
Any comments welcome :)
Thanks
--- On Mon, 10/19/09, Cédrick Béler cdrick65@gmail.com wrote:
From: Cédrick Béler cdrick65@gmail.com Subject: [Newbies] How to implement parameters for an application To: "A friendly place to get answers to even the most basic questions about Squeak." beginners@lists.squeakfoundation.org Date: Monday, October 19, 2009, 9:31 AM Hi,
I use an application that used to have a shared pool for varaibles for global parameters. I removed them and implemented a special class for parameters but I don't feel happy with that.
Is it a good practice to implement parameters as class side method on each relevant model class (instead of having a global container for parameters) ? If yes, I guess I need to use pragma or something else to get these parameters easily.
Any comments welcome :)
Thanks
-- Cédrick
Hmm. What is the application for? How would you model it as a bunch of interacting objects? Can you give a short user story for the application you are trying to create?
What is making you feel uncomfortable about having a class for the parameters? What would make you feel comfortable instead?
I usually get a feeling of discomfort when the code is fighting me. The solution is to think about responsibilities.
Usually the class that owns a parameter is the best place to put the responsibility of dealing with it. If you have classes that are constantly asking others for info then the responsibilities are probably in the wrong place.
Hth,
Yours in curiosity and service, --Jerome Peace
beginners@lists.squeakfoundation.org