Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: mathieson20040309

Message # 1023290:
Date: 12/08/04 18:49
By: crivera Profile
Subject: good basic design?

I am trying to figure out if the way i wrote my code is recommended or not.

My class had a Get/Set/Clear function for each of the class' properties. Well, the code got out of hand when the class had 22 properties. I tried to simplify the code by just creating combine all the Get/Set/Clear funtions into 3 functions and using the property's name as a function parameter. These 3 function now had a big switch statement for each property but is much easier to maintain.

I eventually realized that by adding new properties or adding new code reference the accessor/modifier functions to my class would produce a run time error instead of a compile error. I think that this sacrifice is justified.

What do you think?


Previous Message | Next Message


Comments:
PHP ORM for Shared ServersDan Blaisdell03/03/09 11:09
Php Object GeneratorJake09/13/05 20:37
EZPDO: an easy ORM framework for PHP5xman10107/21/05 16:25
More to it - article is incompleteMilos Radenovic05/27/05 10:20
Database Tablesolivier02/25/05 20:06
RE: good basic design?jojo reyes01/25/05 01:45
Abstracting the database layerjojo reyes01/24/05 22:48
RE: agreedShankar01/17/05 13:21
good basic design?crivera12/08/04 18:49
RE: Breaks fundamental design principlesmmorales05/28/04 10:08
RE: Breaks fundamental design principlesBenjamin Smith04/24/04 03:29
RE: Breaks fundamental design principlesArt Hundiak04/06/04 13:48
RE: Breaks fundamental design principlesFerdinand Beyer04/03/04 06:41
Breaks fundamental design principlesJack Slocum03/27/04 02:32
Good basic design principlesJared White03/20/04 22:56
RE: agreed - maturity neededKieran Mathieson03/15/04 14:11
RE: agreedles03/13/04 09:13
PerformanceLars03/12/04 07:42
agreedCyril Doussin03/11/04 02:52
Code Reuse? Existing Alternativeskellan03/10/04 12:46
Well writtenSurjit Madiwalar03/10/04 05:40
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.