From: jcb@... (MetalOne) Date: 2002-09-17T07:32:23+09:00 Subject: Re: MVC and OO Design? Thanks to all for your help. I was really thinking very abstractly about a problem in my head that MVC kind of demonstrated. I was in search of deep answers in regards to when to include a function in a class and when not too. The common wisdom states that when a function needs access to the classes data, it should be included with the class. MVC strays from this notion because the View needs access to the Models data and yet the View functions are not placed in the class. Abstractly, any function could be thought of as a view function, even if it does not draw a representation of the object. This could lead one to conclude that if a function does not change an object's state, then it should always reside outside the object and query the object for data, just like a View object. Fat classes generally are not considered good design, so I was trying to envision what it would be like to have very thin classes, containing only functions that modify state. Writing all the accessors seemed awkward though. I suppose as always there are no hard fast rules and comprises are required. The responses above brought me back to a more concrete reality. MVC is there to separate out user interface code. It is also true, that I did not understand the roll of the controller. Thinking of a passive Model and a passive View has also helped me with my current problem. Perhaps it is wise to pull functions out of a class along functional lines that require specialized developer skills such as GUI, Database Access, Encryption, etc. Or maybe it only makes sense for GUI, because, of the need to easily change the GUI.