What is Adapter pattern?

  • A design pattern that allows objects with incompatible interfaces to work together by converting the interface of one object into an interface expected by the client
  • A design pattern that creates objects by cloning existing objects, rather than creating new instances from scratch
  • A design pattern that creates objects in a step-by-step manner, allowing for more control over the object creation process
  • A design pattern that promotes the loose coupling between objects, making the system easier to maintain and extend
Adapter pattern is a design pattern that allows objects with incompatible interfaces to work together by converting the interface of one object into an interface expected by the client. This pattern involves creating a wrapper class that implements the target interface and delegates calls to the adaptee object. The adapter acts as a bridge between the adaptee and client, allowing them to work together even if their interfaces are not compatible.

What is Business Delegate pattern?

  • A design pattern that promotes loose coupling by keeping the presentation layer separate from the business layer
  • A design pattern that provides a simplified interface to a set of services
  • A design pattern that reduces the coupling between presentation-tier clients and business services
  • A design pattern that separates the business logic and presentation logic in an application
Business Delegate pattern provides a simplified interface to a set of services to reduce the coupling between presentation-tier clients and business services.

When would you use the Builder Pattern? Why not just use a Factory Pattern?

  • Use Builder Pattern when the construction process is complex with many options and Factory Pattern when the process is simple.
  • Builder Pattern is used when you want to build objects step by step, while Factory Pattern is used when you need to create objects with a single method call.
  • Use Builder Pattern when the number of object's attributes is large, while Factory Pattern is used when you need to hide the creation process.
  • Builder Pattern is used when objects cannot be created in a single step, while Factory Pattern is used when the creation process is simple.
The Builder Pattern is used when the construction of an object is complex, and it allows you to build objects step by step, with each step having a different number of options. This is useful when you want to provide a clean API for creating objects, without exposing the details of the creation process. The Factory Pattern, on the other hand, is used when you need to create objects with a single method call. This is useful when the creation process is simple, and you don't need to provide a clean API for creating objects.

What is the difference between the Service Locator and Dependency Injection patterns?

  • Service Locator is a centralized object that provides access to dependencies, while Dependency Injection provides objects to dependencies directly.
  • Service Locator is a client-side pattern, while Dependency Injection is a server-side pattern.
  • Service Locator is a dynamic method of object creation, while Dependency Injection is a static method of object creation.
  • Service Locator is used to manage the lifecycle of objects, while Dependency Injection is used to manage the dependencies of objects.
The Service Locator pattern involves a centralized object that provides access to dependencies, while Dependency Injection provides objects to dependencies through constructor injection, method injection, or setter injection.

What is the Intercepting Filter pattern?

  • A design pattern used in client-server communication to encrypt messages.
  • A design pattern used in database management to store data in multiple tables.
  • A design pattern used in software testing to validate the functionality of a system.
  • A design pattern used in web applications to pre-process requests before they are sent to the target resource.
The Intercepting Filter pattern is a design pattern used in web applications to pre-process requests before they are sent to the target resource. This is done to add additional functionality to the request such as security checks, data validation, or header modification.

What is Factory pattern?

  • A design pattern used to create objects in a more efficient way
  • A design pattern used to manage the dependencies between objects
  • A design pattern used to manage the lifecycle of objects
  • A design pattern used to manage the relationships between objects
The Factory pattern is a creational design pattern that provides a way to create objects in a more efficient and centralized manner. The Factory pattern abstracts the process of object creation and allows the client code to be decoupled from the actual implementation of the objects being created. This allows for greater flexibility and maintainability in the code, as the specific implementation of the objects can be changed without affecting the client code.

What is Facade pattern?

  • A design pattern that allows objects to be decorated with additional responsibilities, dynamically, at runtime
  • A design pattern that filters a set of objects based on certain criteria and returns a subset of those objects
  • A design pattern that provides a simplified interface to a complex system, allowing the client to interact with the system through a single, unified interface
  • A design pattern that separates an object's implementation from its interface, allowing the two to vary independently
Facade pattern is a design pattern that provides a simplified interface to a complex system, allowing the client to interact with the system through a single, unified interface. The pattern involves creating a facade class that acts as a wrapper around the complex system, providing a simplified interface to the client. This pattern can be useful in situations where you want to simplify the interface of a complex system, making it easier for clients to use the system.

What is the purpose of the Command pattern?

  • To allow for loose coupling between the sender of a request and its receivers.
  • To allow sending requests to objects without knowing anything about the operation being requested or the receiver of the request.
  • To convert the interface of a class into another interface clients expect.
  • To provide a unified interface to a set of interfaces in a subsystem.
The Command pattern is used to allow sending requests to objects without knowing anything about the operation being requested or the receiver of the request. It provides a way to queue or log requests and acts as a marshal between the sender and the receiver.

What will you choose: Repository Pattern or "smart" business objects?

  • It depends on the complexity of the project, but in general "smart" business objects is a better choice as it allows for easier management of business logic.
  • It depends on the requirements of the project, but in general Repository Pattern is a better choice as it provides separation of concerns between the data access and business logic.
  • It depends on the size of the project, but in general "smart" business objects is a better choice as it reduces the number of classes needed.
  • It depends on the team's experience, but in general Repository Pattern is a better choice as it provides a common interface for data access.
The choice between Repository Pattern and "smart" business objects depends on the specific requirements of the project, but in general the Repository Pattern provides better separation of concerns and a common interface for data access.

What is State pattern?

  • A design pattern in which an object, called the composite, is composed of one-to-many other objects, in a tree-like structure, allowing the client to interact with individual objects and compositions of objects uniformly
  • A design pattern in which an object, called the context, holds a reference to an instance of one of several possible concrete state objects, each of which represents a distinct state of the context and implements a common state interface
  • A design pattern in which an object, called the decorator, adds or overrides behavior of an existing object, dynamically
  • A design pattern in which an object, called the prototype, is used as a template to create new objects, without specifying their concrete classes
The State pattern is a design pattern in which an object, called the context, holds a reference to an instance of one of several possible concrete state objects, each of which represents a distinct state of the context and implements a common state interface. The State pattern allows the context's behavior to be altered dynamically by changing its state. The State pattern is used to implement state machines, allowing an object's behavior to be altered as its internal state changes.