Inno 3.0 Statuses, Acronyms Flashcards
(29 cards)
What does the SOLID acronym stand for in object-oriented design?
Single Responsibility,
Open/Closed,
Liskov Substitution,
Interface Segregation, and
Dependency Inversion
What is the Single Responsibility Principle (SRP)
A class should have only one reason to change, meaning it should have only one job or responsibility. This makes the class easier to test and maintain.
What is the Open/Closed Principle (OCP)
Software entities (classes, modules, functions) should be open for extension but closed for modification. You should be able to add new behavior without changing existing code.
What is the Liskov Substitution Principle (LSP)?
Subtypes must be substitutable for their base types without altering the correctness of the program. If class B is a subclass of A, you should be able to use B instead of A without issues.
What is the Interface Segregation Principle (ISP)?
Clients should not be forced to depend on interfaces they do not use. It’s better to have many small, specific interfaces than a large, general-purpose one.
What is the Dependency Inversion Principle (DIP)?
High-level modules should not depend on low-level modules; both should depend on abstractions. This reduces coupling between modules.
What does DRY stand for and mean?
Don’t Repeat Yourself — avoid code duplication. Every piece of knowledge should exist in a single, unambiguous place in the codebase.
What does KISS stand for and mean?
Keep It Simple, Stupid — favor simple, straightforward solutions over complex ones. Simpler code is easier to understand and maintain.
What does YAGNI stand for and mean?
You Aren’t Gonna Need It — don’t implement functionality until it’s actually required. Avoid overengineering.
Why are good naming conventions important in code?
Descriptive names make code easier to read, understand, and maintain over time. They help developers quickly grasp what a class, method, or variable is supposed to do without needing additional explanation. Poor naming can lead to confusion and misunderstandings, especially in team environments. Good naming reduces the need for excessive comments and improves collaboration across the codebase. It’s a fundamental part of writing clean, self-documenting code.
What are common naming practices in .NET?
In .NET, PascalCase is used for class names, method names, and public properties,
while camelCase is used for local variables and method parameters. Interfaces typically start with an “I” (e.g., IRepository).
Meaningful names should be preferred over short or cryptic ones. Avoid abbreviations unless they are very common (like Id or Url). Consistent naming improves readability and ensures the codebase follows predictable patterns.
When should you write comments in code?
Comments should be used to explain why something is done, not what is done — the code itself should tell what. Good comments provide context or rationale that’s not obvious from the code. Avoid writing comments that simply repeat what the code says, or that become outdated as the code evolves. Use comments sparingly and ensure they remain relevant and up to date. Well-placed comments can improve understanding without cluttering the code.
What is the role of documentation in a project?
Documentation serves as a guide to understanding the system, how to use it, and how to contribute to it. It helps new team members onboard more quickly and ensures consistent knowledge sharing. Well-maintained documentation reduces the dependency on specific individuals and improves project continuity. It should include setup instructions, API references, architecture decisions, and usage examples. Good documentation complements readable code and boosts team productivity.
What is Separation of Concerns (SoC)?
SoC is a design principle that advocates dividing a system into distinct layers or components, each responsible for a specific aspect of functionality.
For example, separating presentation (UI), business logic, and data access logic into different layers.
This makes code easier to understand, test, and maintain. It also reduces coupling between parts of the system, making future changes less risky. Following SoC helps build scalable and flexible applications.
DIVINDING SYSTEM INTO LAYERS OR COMPONENTS
Why is SoC important in software design?
When concerns are separated, developers can work on one part of the system without affecting others. This isolation improves maintainability and testability. It also enables better team collaboration, where developers specialize in different layers of the application. SoC supports the principle of single responsibility and allows for cleaner architecture. Overall, it leads to more robust and adaptable code.
What is modular code and why is it valuable?
Modular code is organized into small, self-contained components or modules, each with a clear purpose. These modules can be developed and tested independently, improving reliability and efficiency. It’s easier to reuse modules in other projects or contexts, reducing duplication. Modular design also supports parallel development and simplifies debugging. It’s a key aspect of maintainable and scalable software systems.
How do you achieve code reusability?
Code reusability is achieved by writing generalized, well-abstracted functions, classes, or components.
Avoid duplicating logic and extract shared functionality into services or utilities. Use interfaces and dependency injection to make code flexible and easy to plug into different contexts.
Reusable code saves time and effort, especially in large projects or teams. It also leads to more consistent and reliable applications.
What are the benefits of organizing code by layers (e.g., presentation, business logic, data)?
Layered architecture helps to separate responsibilities and keep the system well-structured. Each layer focuses on a specific task, which improves clarity and maintainability. Changes in one layer (like switching a database) usually require minimal or no changes to others. This structure also enhances testing, as individual layers can be tested in isolation. Organizing code by layers aligns with clean architecture principles and supports scalability.
What does “Stateless” mean in the context of RESTful principles?
“Stateless” means that every request from a client to a server must contain all the information needed to understand and process the request.
The server does not store any client context between requests. Each interaction is independent, and the server does not retain state between requests, which simplifies the design and scalability.
If state is needed, it must be managed by the client or stored on the client side, typically using tokens or cookies.
STATELESS MEANS EVERY REQUEST HAVE ALL THE REQUIRED INFO TO PROCESS IT
What does “Uniform Interface” mean in RESTful principles?
“Uniform Interface” refers to the consistent and standard way of interacting with resources through APIs.
This principle simplifies the architecture, as it decouples the client and server. The interface is based on standard conventions such as HTTP methods (GET, POST, PUT, DELETE) and resource URIs. It reduces the complexity of the system by providing a common understanding of how resources can be manipulated and accessed, leading to better scalability and ease of integration.
What is the significance of “Client-Server” in RESTful architecture?
The “Client-Server” principle emphasizes the separation of concerns between the client and the server. The client is responsible for the user interface and user experience, while the server handles data processing, storage, and business logic. This separation allows both parts to evolve independently. The client and server communicate over a standard interface (typically HTTP), and they are loosely coupled, making the system more scalable and flexible.
What does “Cachable” mean in RESTful principles?
A: The “Cachable” principle states that responses from the server should explicitly define whether they can be cached by the client or any intermediate systems, such as proxies.
If the response is marked properly, it has the information, that it can be stored.
Caching improves performance by reducing the need for redundant data retrieval. It enables the system to handle requests more efficiently, especially when dealing with frequently accessed resources. Caching is typically controlled using HTTP headers like Cache-Control, Expires, and ETag.
THE RESPONSE SHOULD HAVE INFORMATION IF ITS CACHABLE
What does HTTP status code 204 No Content mean?
204 No Content means that the server successfully processed the request, but there is no content to return in the response body. This is often used for DELETE requests or when updating resources where no response body is necessary, but the operation is successful. It tells the client that the request was successful, but no further information is needed.
SUCCESSFULL DELETED
What does HTTP status code 301 Permanent Redirect mean?
301 Permanent Redirect indicates that the requested resource has been permanently moved to a new URI. This status code is used to redirect the client to the new location of the resource, and it tells the client to update its links to the new URI. It is often used when resources are permanently moved or URLs are restructured.