Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Old November 16th, 2006, 01:37 PM
Ursus Ursus is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Maryland, USA
Posts: 402 Ursus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 30 sec
Reputation Power: 7
OOP and business rules

I'm still trying to get my head around OOP, and I need some input. In short, should an object embed the business rules that govern it's use or should the script manipulating those objects control implementing the business rules?

By way of background, I'm working on a site which includes a section for allowing users to subscribe to publications and change some details about the subscriptions they've opted to receive. When a user updates a subscription, if they change attributes like the delivery method or the language of the publication, the client wants the existing subscription to be canceled and a new subscription created.

The subscription object has methods for updating, adding, and canceling subscriptions, which are called by a script which processes the input from the subscription update form. Should that script determine when it's appropriate to cancel the existing subscription and create a new one, or should that logic be built into the update method of the subscription object?

On the one hand, it seems like adding the logic into subscription object makes it easier to update in future. On the other, it seems like I lose some flexibility in how the object is manipulated. What do y'all think?

[edit]
Also impacting this is how the submitted values to update the subscription to (e.g., the new delivery method selected) should be passed to the object so that it can determine if an update to the existing subscription should be made or if the existing subscription canceled and a new one created.

Reply With Quote
Old November 27th, 2006, 09:13 AM
lig's Avatar
lig lig is offline
"Forum Nazi"
Codewalkers Demi-God (4500 - 4999 posts)
 
Join Date: Apr 2007
Location: Jacksonville, Fl
Posts: 4,774 lig User rank is Private First Class (20 - 50 Reputation Level)lig User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 Days 15 h 13 m 9 sec
Reputation Power: 11
RE: OOP and business rules

generally speaking the object should reflect only what that individual object does. I personally would have the application destroy and create a new object - NOT have the object handle it.

It will allow for greater reusability of the object code as well.

Reply With Quote
Old February 5th, 2013, 11:54 PM
kevinloyed kevinloyed is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 18 kevinloyed User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 56 m 38 sec
Reputation Power: 0
OOP (Object Oriented Programming) concept is use in programming language like asp.net, java.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > OOP and business rules


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap