2 ms·
It doesn't sound like you code much business code, most of the code the majority of programmers have to deal with. It tends to consist of a lot of classes of f
by mattmanser 14y ago
It doesn't sound like you code much business code, most of the code the majority of programmers have to deal with.
It tends to consist of a lot of classes of fairly shallow functionality with a lot of data access based on different criteria, meaning a lot of different SQL statements doing minor variations on a theme.
Business code is boilerplate a lot of the time. An organisation has a name, a phone number, an address, an added on date, an added by date, and on and on. An so does a Person, a Project, an Order, an Enquiry.
99% of columns are simple data stores that have no sort of 'unique functionality' you describe. They exist to store data that's only purpose is to be recorded and later re-displayed or updated. Hell most problems that require a DB don't have this 'unique functionality' you describe.
For example a bunch of static methods on an Order class or in a OrderDataAdapter:
Order.Get(id)
Order.Get(accountCoordinatorUsername)
Order.GetUnassigned()
Order.GetOrdersByPartner(id, (optional)boolIncludeCompleted)
etc., etc.
So in reality you add the new propety to your class, let's say 'expectedDealValue', an int for our purposes. But it's mandatory.
You then have to add the column to every method that uses this value. You have to go through all those other totally unrelated methods checking and changing each and every single one of them. And this table is probably accessed in other classes too, say like the QuarterlyReport class, so it's now a find and hunt scenario.
Unless you're relying on SELECT *, but no sane SQL programmer does that right?
In the bad old days you'd start rolling your own ORM to try and manage this mess. It would invariably suck and cause more problems than it solved. Today's ORMs are a god-send to this type of coding.