Codecademy Logo

Software Design Principles

Software Complexity

As software gets more complex over time, it becomes harder to change, slowing the rate of development.

What is Software Design?

Software design is the process of defining the responsibilities of software components as well as how they interact together. The aim of software design is to make it easy to implement future changes in code.

Software Design Diagrams

Diagrams are often used in software design to represent a system’s components, data, and interactions.

Software Design Principles

The principles YAGNI, KISS, and DRY all emphasize keeping the design of a system as simple as possible to reason about and adapt.

Software Architecture

Software architecture describes a model of a system, broken down into components and a description of how those components fit together.

MVC Design Pattern

MVC is a software design pattern that organizes an application into three types of components (Model, View, and Controller) based on their functionality.

The View Component

In the MVC pattern, the View handles the application’s visual presentation. The View components display the Model’s data and communicate user actions to the Controller.

The Controller Component

In the MVC pattern, the Controller defines the behavior of an application and communicates with both the Model and the View. Controller components are responsible for communicating with the Model and handling user interactions from the View.

Pros and Cons of MVC

Following the MVC pattern adds complexity to a project’s organization, but separating concerns offers the developer more flexibility in implementing each component and simplifies making changes later on.

Unified Modeling Language

UML is means of creating a design diagram to visualize the properties of a software component and can be used to document objects at the name, method, and attribute level.

Object Oriented Programming (OOP)

Object-Oriented Programming (OOP) is a design paradigm that organizes code into separate objects that interact with each other. OOP has four primary aspects: encapsulation, abstraction, inheritance, and polymorphism. Each plays a role in making a software system adaptable to change.

Abstraction in OOP

Abstraction is the concept of representing a complex series of steps and actions through another “higher level” concept.

Inheritance in OOP

Inheritance is the concept of a subclass acquiring the attributes and methods of a superclass.

Polymorphism in OOP

In object-oriented programming, polymorphism is the ability to access the behavior of multiple subclasses through the shared interface of a superclass.

UML class diagrams

UML class diagrams contain the names of classes, attributes, method signatures, and relationships among objects.

Single Responsibility Principle

According to the Single Responsibility Principle (SRP), components should have only one reason to change.

Open-Closed Principle

New functionality should be able to be added to a system through the creation of new classes rather than the modification of existing ones.

Liskov Substitution Principle

Software should use interchangeable parts. Any usage of a superclass should be able to be substituted with its subclass.

Dependency Inversion Principle

Classes should depend on abstract rather than concrete classes. Concrete classes should not interact with other concrete classes when possible.

0