|
How come storage does matter?
|
Posted: Oct 10, 2008 3:08 PM
|
|
It's complicated (maybe also because we just had barbecue, and a lot of wine to accompany the meat?)
I met the situation that business logic was implemented split in the database (using stored procedures, queries, views and the like) and in the application code, sometimes mixed with UI code. Without exception, in such cases maintenance was a nightmare. My conclusion is that business logic should be localized. What this means: even if the database provides tenfold increased performance, unless absolutely necessary, do all business logic in code. Even when you have to keep some logic in the database, wrap it nicely in code, so the maintenance/client programmer does not suspect you are actually _not implementing_ that part of the business logic in code.
On the other hand, if we look at the object structure in an app from a services point of view, it is easy to convince ourselves that most OO apps are just a bunch of several, maybe hunreds or thhousands of instances of programs, a program being a class and an instance being an object, which run together and communicate by messages.
In such a world IMO it is obvious that each object/class should implement/use its own serialization/persistence mechanism, without asking other objects about how to do it, and without other objects/classes really caring.
If so, data structure at the low database level becomes meaningless, as it should be dumb from one end to the other. Instead, the important layer becomes the in-mem, deserialized model, but running objects should not care about the persistent/serialized representation of objects they send messages to.
Going back one more step, if messages are sent among objects using a services infrastructure which is language- and platform-agnostig, the data layer is completely out of this discussion.
So here's the question again: how come storage does matter?
|
|