Object oriented design question: classes with mulitiple functions or multiple classes? 
Author Message
 Object oriented design question: classes with mulitiple functions or multiple classes?

Hi all,

First off a confession, I have always been dreadful at object oriented
design.

With that out of the way you have an understanding of where I am coming
from with this question.

I'm working on a new Tkinter application that needs to track some
customer information. However there is *a lot* of information and it
feels like the best method of presenting this large volume of
information will be in a tabbed notebook. The notebook (Pmw.NoteBook),
at present has five tabs with the possibility of more being added later.

I have one master class called customerdisplay.

My question is this: Am I better off creating initialization functions
to initialize and control all of the widgets, or should I create a class
for each page of the notebook and build my display using smaller class
entities?

[On a secondary note, are there any Tkinter widgets that will allow me
to display notebook tabs on the bottom or side instead of the top?]

Thanks for your input!

--
Stand Fast,
    tjg.


Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.                   (503) 246-3630

Quote:
>>>>>>>>>>>>Linux...Because rebooting isn't normal<<<<<<<<<<<<



Wed, 04 Sep 2002 03:00:00 GMT  
 Object oriented design question: classes with mulitiple functions or multiple classes?

Quote:

> There are some screenshots of how to do it right and
> wrong at <URL http://www.iarchitect.com/tabs.html>.

Minor correction to his URL; that looks like a MS
Windows box as it wants ".htm" instead of ".html"

   http://www.iarchitect.com/tabs.htm

                    Andrew



Fri, 06 Sep 2002 03:00:00 GMT  
 Object oriented design question: classes with mulitiple functions or multiple classes?

Quote:

>First off a confession, I have always been dreadful at object oriented
>design.

And I'm lousy at graphical design.  Pleased to meet you.

Quote:
>I'm working on a new Tkinter application that needs to track some
>customer information. However there is *a lot* of information and it
>feels like the best method of presenting this large volume of
>information will be in a tabbed notebook. The notebook (Pmw.NoteBook),
>at present has five tabs with the possibility of more being added later.

In that case, it's time to seriously reconsider using tabs.  Tabs are fine
when there's only three or four logical ones, but when you don't even know
what you're going to have in the future they're pure poison.

The most general replacement for them is a tree control; however, tree
controls are hard to build and use, and if you can fit your choices neatly
into a list your users will be much happier.  There are some screenshots
of how to do it right and wrong at <URL
http://www.iarchitect.com/tabs.html>.

Quote:
>My question is this: Am I better off creating initialization functions
>to initialize and control all of the widgets, or should I create a class
>for each page of the notebook and build my display using smaller class
>entities?

I suppose you're using Tkinter; I'm not familiar with that.  The toolkits
I know about use objects, not classes, and you HAVE to have one per page.

Quote:
>[On a secondary note, are there any Tkinter widgets that will allow me
>to display notebook tabs on the bottom or side instead of the top?]

Before you do this, though, consider something else.  ANYTHING else.

Quote:

>Red Hat Certified Engineer            www.exceptionalminds.com

Cool.

--
-William "Billy" Tanksley



Sat, 07 Sep 2002 03:00:00 GMT  
 Object oriented design question: classes with mulitiple functions or multiple classes?

Quote:

>First off a confession, I have always been dreadful at object oriented
>design.

Ditto, but I seem to be getting better with experience.
And the Design Patterns book helped.

Quote:
>I have one master class called customerdisplay.

>My question is this: Am I better off creating initialization functions
>to initialize and control all of the widgets, or should I create a class
>for each page of the notebook and build my display using smaller class
>entities?

I was working on an entirely different project.  It had nothing in
common.  But I also had a since "Master Class", with many functions.
Eventually, as the requirements changed, the class became 1400 lines
long.  Then it was a total mess.  So the company refactored it so
that each function was a "Command" (a separate class, containing a
single "execute" method), and since then, whenever the client has
wanted to add new functionality, all we had to do was add another
class, and test it, instead of making our "Blob" class even bigger,
and having to re-test everything.

All the utility functions, that weren't called by anyone else moved
into the Base Command Class.  It turned out to be much nicer, since
each class is very small, and only does one thing.  And they tend
not to call each other.

These days, I get worried when I hear terms like "Master Class".  ;)

Later,
Blake.
--
4:20pm up 23 days, 19:12, 1 user, load average: 1.00, 1.00, 1.00



Mon, 09 Sep 2002 03:00:00 GMT  
 Object oriented design question: classes with mulitiple functions or multiple classes?

Quote:
> >First off a confession, I have always been dreadful at object oriented
> >design.

> Ditto, but I seem to be getting better with experience.
> And the Design Patterns book helped.

Is that actually the title of the book, I'll have to go look for it at
Fatbrain.

Quote:
> These days, I get worried when I hear terms like "Master Class".  ;)

Thanks for your input Blake. Much appreciated, I didn't expect a deluge
of response to this, but I thought it would open up an interesting
discussion, so far, you are the only discussee!

Your reasons for the smaller classes go along with my thoughts. My first
project in Tkinter I ended up with a *monster* class, that while
uweildly was not completely unmanageable, but it seemed wrong to me,
hence the question.

--
Stand Fast,
    tjg.


Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.                   (503) 246-3630

Quote:
>>>>>>>>>>>>Linux...Because rebooting isn't normal<<<<<<<<<<<<



Tue, 10 Sep 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CLOS and Object oriented classes for CL wanted

2. Good design of object-oriented extension classes

3. GUI/data object oriented design question

4. Compare object-oriented and function-oriented ....

5. The use of the Factory Paragraph versus Class-Object in Object Oriented (OO) COBOL

6. ANNOUNCEMENT: Object-Oriented Systems - new object-oriented journal

7. ANNOUNCEMENT: Object-Oriented Systems - new object-oriented journal

8. New Book "Object-Oriented Design Heuristics

9. Object Oriented Design

10. Course Announcement: Object Oriented Analysis, Modeling, & Design

11. Formal Specification and object oriented design

12. Tools for Object-Oriented Design/Analysis/Programming

 

 
Powered by phpBB® Forum Software