|
Posted by Steve on 08/24/07 18:43
| That being the case, I have some more specific inquires into the
| group's and ElINT's opinion on OOP. It's possible I'm not fully
| understanding the way you describe it, ELINT, so if I'm reiterating
| what you've already said, I apologize in advance. The approach I might
| take, is as follows:
| My Product class which is a member of the Order class, of which I
| mentioned in my OP, would be my parent class. My reasoning for this is
| because the Product class is already used in so many other scripts, I
| wouldn't feel entirely comfortable suddenly making it a child class of
| some other super class.
i *completely* disagree...you are not programming for your *comfort*. you
program to get it correctly. you should have an *item* class implemented by
product which will further be extended and used by the free product class.
additionally - and the main reason you should *not* make the base class
'order' - your company could begin selling *services* and as far as billing
goes, would be so similar in structure as 'product', you'd want to reuse the
base that way. finally, since an 'order' consists of line 'items', you can
use the 'item' interface to process the order (shipping, billing, inventory,
etc.) without having to look at any other specific differences between the
inheritors (product, free product, service).
again, do it right so the code base is *sound*...don't avoid doing something
because it is *uncomfortable*. the only reason to keep from refactoring
completely is because of costs.
but that's just my 0.02 usd
[Back to original message]
|