|
Posted by Kenneth Downs on 08/25/05 23:42
Jerry Stuckle wrote:
>
> The real beauty of properly written OO is to separate the data
> representation
> (i.e. storage, etc.) from the use of that data. A simple case - I needed
> to get a web site up quickly (one day) on a (low cost) host where MySQL
> wasn't working
> reliably. While the host worked on the problem, I created classes
> representing
> the data storage which used CSV files and stored all my data there. I
> created
> all the dynamic web pages based on the classes. Once they got MySQL
> working
> properly, I simply changed the classes to use MySQL instead. I changed
> only the
> class files - instead of numerous web page files.
What you did is easily done w/o resorting to OO. It's even easier when you
are not messing with OO because you don't get the confusion of having
methods with the same name in multiple places doing differen things.
A good programmer will always have a wrapper layer between his own code and
outside systems like databases. There is always some program "Query()"
that can be quickly rerouted to pull CSV's instead of tables, or Oracle
instead of Postgres.
You have good habits, but do not mistake them as features of OO, because
they are not. Anything possible in OO can be done without it, usually with
less code and usually it turns out to be easier to maintain.
--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Navigation:
[Reply to this message]
|