Oops! OO Patterns vs OO Principles vs OO Programming Systems
By: Anoop Gupta
Tags: Design Patterns, Design Principles, Object Oriented, Software Development

Preface: That blog is all about a basic introduction to OOPS, Design Patterns, and Principles. It is not meant for learning OOPS concepts in detail :)

Last evening I was spending my quality time after office hours with some of my colleagues including some junior team members.

I read somewhere that “Girls want attention and women want respect” and to extend that statement in men’s world. “ Men want a beer and drunk men want a discussion and on the top of that “Drunk techie men want to discuss OOPS”. isn’t it ironic? At least with me, it happens quite often.

Anyways, to spoil that evening one of my teammates asked a very simple question. “What’s the full form of OOPS”?

What do you think?

Here are some answers, you have to choose:

A. Object Oriented Principles

B. Object-Oriented Patterns

C. Object-Oriented Programming System

D. An exclamation word in English used to show recognition of a mistake

You won’t believe Option D was my answer. That was: Oops! A fight is going to start.

In order to stop that discussion, I pitched in and asked a question for question.

What do you understand by Principles and Patterns?

I got some mixed answers and then started giving my explanation and kept aside OOPS.

In plain English, the main difference between a Pattern and Principle is:

Pattern: Pattern is a general solution to a commonly occurring problem.

Principle: Principle is a set of guidelines to implement any pattern.

In Object-Oriented Programming Systems, yes you got it right, (that’s a full form of OOPS) or in software engineering, there are different concepts of Design Patterns and Design Principles, given as follows:

Design Pattern: By definition, a Design Pattern is a general reusable solution to a commonly occurring problem within a given context in software design.

Example: Factory, Singleton etc which come under a superset of design patterns commonly known as Gang of Four

Design Principles: Design principles represent a set of guidelines that help us to avoid having a bad design and direct to implement a better solution.

For example: SOLID principles of OOPS

S.O.L.I.D stands for:

When expanded the acronyms might seem complicated, but they are pretty simple to grasp.

S — Single-responsiblity principle

O — Open-closed principle

L — Liskov substitution principle

I — Interface segregation principle

D — Dependency Inversion Principle

We can learn more about design patterns and principles in my upcoming blog.

Let’s discuss OOPS — Object Oriented Programming System

In this world, everything (living or nonliving) is an Object, a real-world entity such as book, tv, chair, table etc.

Object-Oriented Programming System is a methodology to design a software solution using classes and objects. It simplifies the software development by providing some concepts known as elements of Object Oriented Development.

1. Object

2. Class

3. Inheritance

4. Polymorphism

5. Abstraction

6. Encapsulation

I will provide a detailed blog about Elements of Object Oriented Programming.

I tried my best to explain little things in a better way and thanks to my teammate who asked that question because “If you want the answer — ask the question.”