Moving away from OOP
Learn why moving beyond basic OOP to design patterns is essential. Discover how architecture improves code quality and system design.
OOP is the full form of Object Oriented Programming. And even when starting a career in software engineering, we are forced to implement OOP in our coding. Cross your heart and tell me how many times we are actually implementing it???
I started my career with .Net / C#. And C# is an object oriented language. But I coded like C, pushing functions for everything. Maybe it is my love for it. And what happened? I ended up with 14,000 lines of code and crashed the system. At that point in time, I shifted and optimized my code, which ended up with 700 lines of code and a pretty nice working product. This is the first time I came to know that there is a use of object oriented systems other than writing exams and cracking interviews.
But again, it's just about creating objects, nothing else. Then I worked with a pretty big web application. At that point, I learned something about Architecture. Oh! That is nice. Even software also has an Architecture. So, is it moving away from OOP? Maybe yes???
It is like the difference between a Civil Engineer and an Architect. It is some advanced functionality which is implemented using Object Oriented fundamentals. And these are not new things but advanced versions of what I have learned. These are Design Patterns.
First it was created by Gang of Four. They are the pillars and pioneers of design patterns. Although it is easy to learn, it is hard to choose between them. But maybe in the future I will be writing something on these patterns. Till then, if you are from a Dot Net background, do check out this site. It has all the details needed to learn Design Patterns.
Frequently Asked Questions
OOP is the fundamental programming paradigm focused on creating objects and organizing code, while Software Architecture is an advanced layer built on OOP fundamentals that deals with the overall system design and structure. Architecture involves applying Design Patterns—proven solutions to common coding problems—which are more advanced implementations of OOP principles. Think of it like the difference between a Civil Engineer (OOP) and an Architect (Software Architecture).
Moving beyond basic OOP to proper architecture and design patterns can dramatically improve code efficiency and maintainability. The author's experience demonstrates this—14,000 lines of procedural code that crashed the system was optimized to just 700 lines using proper OOP principles and architecture. Without architectural thinking, even object-oriented code can become bloated and problematic.
Design Patterns are reusable solutions and best practices for solving common programming problems, created by a group known as the Gang of Four. They represent advanced implementations of OOP fundamentals and provide proven approaches to software design. While they're easy to learn individually, choosing the right pattern for your specific problem can be challenging.
The author recommends checking out specialized resources like dofactory.com, which provides comprehensive details on Design Patterns specifically for .NET developers. These resources will help you understand when and how to apply different patterns to improve your software architecture and code quality.