Please take note - Software engineering principles. | INFJ Forum

Please take note - Software engineering principles.

Discussion in 'Computer Science' started by DimensionX, Mar 10, 2015.

Share This Page

More threads by DimensionX
  1. DimensionX

    Donor

    Joined:
    Jan 31, 2010
    Threads:
    49
    Messages:
    1,237
    Likes Received:
    288
    Trophy Points:
    642
    MBTI:
    INFJ
    Enneagram:
    -
    Introduction
    Having had a day spent mainly digging through a code file that has over 10k lines of code in it, really regretting some of the choices I've made that led up to that point, I found myself wishing that the following design principles were taught in school so here for your edification:

    OO Design principles

    - Encapsulate what varies.
    - Favour composition over inheritance.
    - Program to an interface not an implementation.
    - Strive for loosely coupled designs between objects that interact.
    - Classes should be open for extension but closed for modification.
    - Depend on abstractions. Do not depend on concrete classes.
    - Every responsibility of a class is an area of potential change, more than one responsibility means that there's more than one area of change. with that in mind keep each class to a single responsibility.
    - Low level components should never be able to call a high level component directly, low level components should be able to participate in the processing. High level components should determine when and how low level components are needed.
    - Utilize the principle of least knowledge a single class shouldn't be talking to many others otherwise it will create a very fragile system.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 DimensionX, Mar 10, 2015
    Last edited: Mar 12, 2015
    noisebloom likes this.
  2. ruji

    ruji Well-known member

    Joined:
    Dec 29, 2009
    Threads:
    29
    Messages:
    17,147
    Featured Threads:
    4
    Likes Received:
    54,122
    Trophy Points:
    3,257
    MBTI:
    .
    This is my level
     
    noisebloom likes this.
Loading...

Share This Page