Page 1 of 1

Application design question

Posted: Fri Apr 01, 2005 10:08 am
by Chonk
Im writing an in house pc-service centre type application and need some input on my initial design layout.

It will be my first OOP project (well one that will actually by in constant use) and don't want the hair pulling frustration of re-writing it again because of bad design.

The system is simply a way of engineers booking systems in with customer details and relevent problems to the computer system. I think i may however got a bit 'Class Mad' or perhaps i've got it spot on :?

Each is a class i plan to create :
User Authentication : Logging in and checking input.
Template : A simple class to remove presentation from the 'real' code.
Ticket class : When a ticket is called it is removed from database and put into this class for 'tinkering'
Ticket Update : Using the previous class to update information in the database.
Message Class: A class to handle the 'message system' i plan to implement to pass notes.

I would appreciate some input into what other classes you would or wouldn't use.

Re: Application design question

Posted: Sun Apr 03, 2005 7:25 pm
by McGruff
Chonk wrote:It will be my first OOP project (well one that will actually by in constant use) and don't want the hair pulling frustration of re-writing it again because of bad design.
I'm afraid you can probably expect to do this several times as you learn about OOP. One thing that might help is unit testing (see signature link). If you have tests for all your classes, run all the tests after every edit, and fix any problems, the application will always remain in a functional state (known as regression testing). Testing is a vital element in object oriented programming.
Chonk wrote:I think i may however got a bit 'Class Mad'.
That's just a beginning. You could easily have dozens of objects in a single script. I'd probably be slightly concerned if you didn't since good classes should (as a rule) be small and lean, doing just one thing CohesionAndCoupling. Last time I counted I had over 50 in a forum script.

I'd recommend Martin Fowler's Patterns of Enterprise Application Architecture as an essential textbook - you can see the patterns catalogue here but the book explains in more detail. It might not make a lot of sense at first but later it will.

Probably the best forum for OOP design discussions is over on sitepoint.