Re: [Pharo-project] Maybe a brain dead idea
I want it because this classes are just for a migration from RDB to Smalltalk. No I see not smells because I do really want to get all the data from the Relations accessible. Feel free to ask the ActiveRecord developers or their smells. Regards Friedrich -- Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus
Re: [Pharo-project] Maybe a brain dead idea
Lukas Renggli reng...@gmail.com writes: In OB/RB you can select refactor class create accessors or on invidual variables refactor variable create accessors; as well as refactor your classes to use direct variable access or accessors (both ways). That's in the browser or not. I use it to generate a complete code for a class with a program. Regards Friedrich -- Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus
Re: [Pharo-project] Maybe a brain dead idea
Dale == Dale Henrichs dhenr...@vmware.com writes: Dale | Dale | You should design your object's interface respecting the needed Dale | protocols, not its internal design. Bad code smell otherwise. Dale If your intent is to provide for subclassing in the future (or Dale tomorrow), then you should use accessors exclusively. There is a Dale place for such tool functionality. I disagree even with that. An instance variable is not an interface... it's an implementation detail, even in the presence of subclassing. The interface should be about the behavior, not the implementation. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion
Re: [Pharo-project] Maybe a brain dead idea
Randal, In certain situations a method (accessor or not) is an implementation detail ...the smell is in the nose of the sniffer... Dale - Original Message - | From: Randal L. Schwartz mer...@stonehenge.com | To: Dale Henrichs dhenr...@vmware.com | Cc: Pharo-project@lists.gforge.inria.fr | Sent: Wednesday, July 27, 2011 8:35:19 AM | Subject: Re: [Pharo-project] Maybe a brain dead idea | | Dale == Dale Henrichs dhenr...@vmware.com writes: | | Dale | | Dale | You should design your object's interface respecting the | needed | Dale | protocols, not its internal design. Bad code smell | otherwise. | | Dale If your intent is to provide for subclassing in the future (or | Dale tomorrow), then you should use accessors exclusively. There is | a | Dale place for such tool functionality. | | I disagree even with that. An instance variable is not an | interface... it's an implementation detail, even in the presence of | subclassing. The interface should be about the behavior, not the | implementation. | | -- | Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 | 777 0095 | mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ | Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. | See http://methodsandmessages.posterous.com/ for Smalltalk discussion |
Re: [Pharo-project] Maybe a brain dead idea
On 26 July 2011 17:27, Friedrich Dominicus fr...@q-software-solutions.de wrote: or maybe not. I have searched for a way to generate accessor functions with a program, but did not understand the implementaion on Pharo but I've stolen something from Gemstone Smalltalk (if that is not ok, would someone please be so kind to tell me) and there is a method compileMissingAccessingMethods and here it is: compileMissingAccessingMethods Creates accessing and updating methods for all instance variables that do not already have such methods. Maybe I was just to stupid to find the according function in Pharo, however this stuff seems to do what I wanted it do do. If someone has a better idea or just tell me the function of it in Pharo, well then please do so. Yes, see the #createInstVarAccessors method implementation in Browser. I think you can stole it from there and rewrite for own needs :) Regards Friedrich -- Best regards, Igor Stasenko AKA sig.
Re: [Pharo-project] Maybe a brain dead idea
Friedrich == Friedrich Dominicus fr...@q-software-solutions.de writes: Friedrich I have searched for a way to generate accessor functions with a program, Friedrich but did not understand the implementaion on Pharo but I've stolen Friedrich something from Gemstone Smalltalk (if that is not ok, would someone Friedrich please be so kind to tell me) and there is a method Why would you want accessors for *all* your instance variables? Methods provide the public interface for a class's objects. An object that is just a bag of bits such that any other object can get or set every one of its instance variables is better represented as a Dictionary. You should design your object's interface respecting the needed protocols, not its internal design. Bad code smell otherwise. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion
Re: [Pharo-project] Maybe a brain dead idea
In OB/RB you can select refactor class create accessors or on invidual variables refactor variable create accessors; as well as refactor your classes to use direct variable access or accessors (both ways). Lukas On Tuesday, 26 July 2011, Igor Stasenko siguc...@gmail.com wrote: On 26 July 2011 17:27, Friedrich Dominicus fr...@q-software-solutions.de wrote: or maybe not. I have searched for a way to generate accessor functions with a program, but did not understand the implementaion on Pharo but I've stolen something from Gemstone Smalltalk (if that is not ok, would someone please be so kind to tell me) and there is a method compileMissingAccessingMethods and here it is: compileMissingAccessingMethods Creates accessing and updating methods for all instance variables that do not already have such methods. Maybe I was just to stupid to find the according function in Pharo, however this stuff seems to do what I wanted it do do. If someone has a better idea or just tell me the function of it in Pharo, well then please do so. Yes, see the #createInstVarAccessors method implementation in Browser. I think you can stole it from there and rewrite for own needs :) Regards Friedrich -- Best regards, Igor Stasenko AKA sig. -- Lukas Renggli www.lukas-renggli.ch
Re: [Pharo-project] Maybe a brain dead idea
To enable evolution, I'd say. Encapsulation is quite a barrier to adaptation. Ideally, the behaviour that pushes the boundaries would be refactored into the class... Eventually, over time, likely that no client object would need to do direct access to leverage the object. That's when you have a mature class. Regards, Gary - Original Message - From: Randal L. Schwartz mer...@stonehenge.com To: Friedrich Dominicus fr...@q-software-solutions.de Cc: Pharo-project@lists.gforge.inria.fr Sent: Tuesday, July 26, 2011 4:59 PM Subject: Re: [Pharo-project] Maybe a brain dead idea Friedrich == Friedrich Dominicus fr...@q-software-solutions.de writes: Friedrich I have searched for a way to generate accessor functions with a program, Friedrich but did not understand the implementaion on Pharo but I've stolen Friedrich something from Gemstone Smalltalk (if that is not ok, would someone Friedrich please be so kind to tell me) and there is a method Why would you want accessors for *all* your instance variables? Methods provide the public interface for a class's objects. An object that is just a bag of bits such that any other object can get or set every one of its instance variables is better represented as a Dictionary. You should design your object's interface respecting the needed protocols, not its internal design. Bad code smell otherwise. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 mer...@stonehenge.com URL:http://www.stonehenge.com/merlyn/ Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc. See http://methodsandmessages.posterous.com/ for Smalltalk discussion
Re: [Pharo-project] Maybe a brain dead idea
| | You should design your object's interface respecting the needed | protocols, not its internal design. Bad code smell otherwise. If your intent is to provide for subclassing in the future (or tomorrow), then you should use accessors exclusively. There is a place for such tool functionality. Bad smells are always subjective:) Dale