As a Software Engineer with a critical eye on software development, I am truly fond of software architectures that are simple, functional & extensible.
I have praised several times the design of a, god forbid, Microsoft product called Reporting Services due to its greatly designed layered architecture, of which you can catch a glimpse here.
The communication protocols that have changed the world we live in today are based on such a layered model and, surprise, most software is.
The most common approach to developing software systems that operate on some sort of data is the seminal three-tier architecture separating Presentation, Business and Data.
Early on in my development career I tried to follow this approach, or some variation of it, and it clearly paid off, so I stuck with it.
Of course, this is only the first step in the natural evolution of a good software designer. Mastering design patterns quickly follows and not soon enough you’re dealing with domain specifications and shared information models.
But i digress. What I mean to stress here is: the implementation technology does not matter. the system design & architecture does. If you haven’t heard this enough, here it is again.
Still, I am surprised to see around me many (commercial) examples of such poorly designed software.
The Smart UI Anti-Pattern is well described by Evans and is an example of a common problem in software I have come into regular contact with.
Typically, these systems have two layers: the presentation and the data layer, with the business logic spread between the user interface and the database, through the use of some sort of basic Workflows on the UI side and Stored Procedures and Triggers on the DBMS side.
This is even worse then the scenario described by Evans, in which the business logic is all placed in the interface, using the relational database as a shared repository of data.
Also, let me tell you that SQL means “Structured Query Language”. Query as in querying data. SQL is very useful for extracting data, not for applying business logic to it. The next time you use a cursor, you should be using an Entity or a Model of some sorts in your favorite OOP language.
When you have business & domain logic spread throughout both layers, maintenance, flexibility & integration have all gone down the drain. Yet, he still legitimates this approach when certain conditions are in place. I refute them:
The disadvantages are huge:
This rant is an effort to spread good design practices because the use and abuse of such anti-patterns have become so common that there is a whole business model built around them. It’s called Enterprise Application Integration and it enables you to pay to the consultant what you tried to save by not hiring capable developers or procuring yours COTS adequately when the time was right.