Software Design Concepts Flashcards
Idempotence
Idempotence, in programming and mathematics, is a property of some operations such that no matter how many times you execute them, you achieve the same result. In programming, idempotence can be a property of many different code elements, including functions, methods, requests and statements.
IoC
Inversion of control
Inversion of control (IoC)
Inversion of Control is a design pattern that helps to decouple the components in a system, making them more flexible, reusable, and testable. It allows developers to write more loosely-coupled code, which results in a more maintainable and extensible system.
Dependency Injection
Dependency injection (DI) is one form of IoC where we delegate the responsibility of creating and injecting components’ dependencies to some other party outside of the components themselves.
What is inversion of control life cycle?
Inversion of Control (IoC) is a software design principle responsible for the lifecycle of objects throughout the application. The mission of IoC is to manage the instances used in the application and to reduce dependency.
What is SOLID?
SOLID is a popular set of design principles that are used in object-oriented software development. SOLID is an acronym that stands for five key design principles: single responsibility principle, open-closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle.
Single Responsibility Principle
Single-responsibility Principle (SRP) states:
A class should have one and only one reason to change, meaning that a class should have only one job.
Open-closed principle
Open-closed Principle (OCP) states:
Objects or entities should be open for extension but closed for modification.
This means that a class should be extendable without modifying the class itself.
Liskov Substitution principle
Liskov Substitution Principle states:
Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T.
This means that every subclass or derived class should be substitutable for their base or parent class.
Interface segregation principle
Interface segregation principle states:
A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.
Dependency Inversion principle
Dependency inversion principle states:
Entities must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but they should depend on abstractions.
This principle allows for decoupling.
What are Microservices?
Microservices - also known as the microservice architecture - is an architectural style that structures an application as a collection of services that are:
Independently deployable
Loosely coupled
Organized around business capabilities
Owned by a small team
The microservice architecture enables an organization to deliver large, complex applications rapidly, frequently, reliably and sustainably - a necessity for competing and winning in today’s world.
What is a Deterministic function?
A deterministic function always returns the same results if given the same input values.
What is Polymorphism?
Polymorphism means “many forms”, and it occurs when classes are related to each other by inheritance. Allows us to perform a single action in different ways. Think of a base class Animal that has a method of animalSound(). The derived animals perform the same action in their own way.
What is Lexical Scoping?
Lexical scoping is a way of defining how variables and functions interact based on their position within the code. Refers to the ability of a function to access variables from the parent scope.