Code Monkey home page Code Monkey logo

design-principle-pattern's Introduction

OOP

Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects.
In OOP, objects are instances of classes, and these objects can contain both data (attributes or properties) and code (methods or functions). OOP is a way to structure the code using objects and classes.

There are four main principles in OOP:

  1. Encapsulation: This involves bundling the data (attributes) and the methods that operate on the data into a single unit, known as a class. Encapsulation helps in hiding the internal state of objects and only exposes the necessary functionalities.

  2. Abstraction: Abstraction focuses on showing only the necessary details of an object and hiding its complexity. It allows programmers to work with high-level models without concerning themselves with the nitty-gritty implementation details.

  3. Inheritance: Inheritance allows a class (subclass or child class) to inherit properties and behaviors from another class (superclass or parent class). This facilitates code reuse and allows for the creation of hierarchical relationships between classes.

  4. Polymorphism: Polymorphism means having the ability to take different forms. In OOP, it allows objects of different classes to be treated as objects of a common superclass. This allows for flexibility in handling different types of objects through a uniform interface.

Design Principle: (Low level, generate guidelines).

Design principles are guidelines/best practices for creating maintainable, flexible, and understandable software.

OOP provides a way to structure the code using objects and classes, design principles guide how to create these objects and classes effectively.

Design Pattern: (High-level, concrete code).

The design pattern is a general repeatable solution to a commonly occurring problem in software design.

Principles are rules while patterns are their concrete example.

design-principle-pattern's People

Contributors

kabircse avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.