[Tutor] class design
norman at khine.net
Sat Jun 6 16:43:01 CEST 2009
http://docs.hforge.org/itools/web.html although this is for the newer
version, in my case i am maintaining an older version.
On Sat, Jun 6, 2009 at 3:24 PM, Kent Johnson<kent37 at tds.net> wrote:
> On Sat, Jun 6, 2009 at 8:26 AM, Norman Khine<norman at khine.net> wrote:
>>> You probably don't want the view code in the same class with the data.
>>> It's generally a good idea to separate the model - the representation
>>> of data - from the view - the display of the data.
>> In iTools, each class has a view, edit, state etc... functions
>> depending on the class.
> Can you point to an example in the itools docs? I don't see this
> usage. There are a some of disadvantages to this design.
> - it ties the data model to a specific view technology, whether text,
> Tkinter, HTML, or whatever
> - it makes it more difficult to have multiple views, for example
> summary and detail views, or admin edit vs user edit
> I only couple a model class to a representation of the model when they
> are very tightly linked, for example in serialization. User views
> should be decoupled from the model.
More information about the Tutor