Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld Talkback >> 958783

Pages: 1
Anonymous
Unregistered




Design Trade-offs
      #5363 - 01/19/04 10:32 AM

Design decisions ultimately come down to trade-offs. This article proposes adding a layer of abstraction and complexity (thus ensuring a maintenance nightmare) all in the name of preserving encapsulation. I favor ease of use and maintainability over complexity (KISS - Keep It Simple, Stupid). Hiding implementation details by not using accessors/mutators is irrelevant given the fact that object creation requires constructors. Constructors can (and do) take parameters. Doesn't the constructors parameter type expose the underlying implementation type? I would argue that an implementation type change occurs very rarely. If it does the designer/architect didn't do his/her job correctly.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Anonymous
Unregistered




Re: Design Trade-offs [Re: Anonymous]
      #5368 - 01/20/04 10:05 AM

I would disagree with that. I have been on a project that has been under continious develoment (EXTENSIONS on the original functionality). It started as a relatively simple application, but over time, there was a lot of extra business rules that needed to be added. You will have to change signatures/types of objects, since the original design wasn't able to account for all those future logic/requirements. It is not that the design is bad, it was good for the requirements set at that time.
We have had nightmare WEEKS refactoring out some key classes that needed to change (the application has over 3000 classes, as to indicate the complexity), the base class was used in about 800 of them, When we encountered this, Me and some coleagues have decided to start to redesign a LOT of classes to use patterns similar to the ones described. By eliminating a lot of data transferring (and thus getter/setter methods) we have saved AGES of time. A few days ago, one of the core business objects had to change (i rewrote half of it, added fields, removed others, and changed the type of some). It is used thrroughout some 600 classes, and I only needed to maintain 12 of them to incorporate the change.
I would see you do this when you rely on getter/setter methods for doing stuff with your objects.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 1 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 5454

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5