I hear you man. I also live in your world. A world in which business people demand reports. Comprehensive reports. Reports that are easily generated with complex stored procedures. In this world, it is easy to think that the database is king, and it controls the application. This line of thought leads to a complex base TSQL code, views, functions, and stored procedures.
Of course, if this is really the report you need, a complex SQL query might be the answer. However, you want to know how to get out of this data-driven world and enter an object-oriented world.
I think typical OO design tutorials will not justify you. Who cares if the dog is a type of animal, and the German Shepherd is a type of dog. This does not explain how you do business at your job. In addition, this is just an example of the inheritance of the TOE. Other OO patterns, such as composition and dependency injection, are much more useful in most cases.
As I think, you should approach the next project or task - temporarily forget about the database. Imagine that you live in a magical world where data from the database should not be received, and writing data back to the database also does not have to happen. You live in a world where your objects are always filled with the right data. First model your objects in this abstract world. After that (then and only then) you will have problems with the confusing implementation of the process of obtaining and writing to the database. The database is only available to save your data. Your data is alive because you have already modeled it in accordance with the rules of your domain.
Understanding UML will greatly help in this type of modeling. First use UML models to model your domain. Then the code for these projects. Then use them to meet the limitations of your database.
Eric Evans "Domain Driven Design" is a great book that clogs this and many other related moments at home. He emphasizes that domain modeling is a critical element in successful application modeling. He further indicates that object-oriented design is better suited for domain modeling than any other type of programming paradigm.
Good luck. After you embrace the fully simulated, fully typed world of objects, you no longer want to parse another dataset again.
source share