Design Patterns in technology documentation

AraniNavaratnarajah2 15 views 13 slides Jul 31, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

its about behavioral, structural and creational patterns


Slide Content

Design Patterns By: Name

Creational Patterns

Singleton Patterns The Singleton pattern ensures a class has only one instance and provides a global point of access to it. This pattern is useful in scenarios where exactly one object is needed to coordinate actions across the system. Key Features: Private Constructor: Restricts instantiation of the class from other classes. Static Instance: Holds the single instance of the class. Global Access Point: Provides a method to access the instance.

Builder Patterns The Builder pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations. It is useful for creating objects with many optional parts or configurations. Key Features: Builder: Specifies an abstract interface for creating parts of a Product object. Concrete Builder: Constructs and assembles parts of the product by implementing the Builder interface. Product: Represents the complex object under construction. Director: Constructs an object using the Builder interface.

Structural Patterns

Adapter Patterns The Adapter pattern converts the interface of a class into another interface that a client expects. It allows incompatible interfaces to work together, acting as a bridge between them. Key Features: Adapter: Implements the interface that the client expects. Adaptee : The existing interface that needs adapting. Client: The class that interacts with the adapter.

Bridge Patterns The Bridge pattern decouples an abstraction from its implementation so that the two can vary independently. This pattern is useful when both the abstraction and the implementation need to be extended using inheritance. Key Features: Abstraction: Defines the abstraction's interface and maintains a reference to an object of type Implementor. Refined Abstraction: Extends the interface defined by Abstraction. Implementor: Defines the interface for implementation classes. Concrete Implementor: Implements the Implementor interface.

Composite Patterns The Composite pattern allows you to compose objects into tree structures to represent part-whole hierarchies. This pattern lets clients treat individual objects and compositions of objects uniformly. Key Features: Component: Declares the interface for objects in the composition. Leaf: Represents leaf objects in the composition. A leaf has no children. Composite: Defines behavior for components having children and stores child components.

Behavioral Patterns

Command Patterns The Command pattern encapsulates a request as an object, thereby allowing parameterization of clients with different requests, queue or log requests, and support undoable operations. Key Features: Command: Declares an interface for executing an operation. Concrete Command: Implements the Command interface to perform a specific action. Invoker: Asks the command to carry out the request. Receiver: Knows how to perform the operations associated with carrying out a request.

Interpreter Patterns The Interpreter pattern provides a way to evaluate language grammar or expressions. This pattern involves defining a grammar for a language and an interpreter that uses the grammar to interpret sentences in the language. Key Features: Abstract Expression: Declares an interface for interpreting. Terminal Expression: Implements an interpret operation for terminal symbols. Nonterminal Expression: Implements an interpret operation for nonterminal symbols. Context: Contains information that is global to the interpreter.

Observer Patterns The Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. Key Features: Subject: Maintains a list of observers and notifies them of any state changes. Observer: Defines an updating interface for objects that should be notified of changes in a subject.

Conclusion Applying design patterns to the given scenario enhances the system's maintainability, scalability, and flexibility. The Singleton pattern ensures a single point of control for the Systems Manager. The Factory Method pattern abstracts the creation process, promoting loose coupling. The Composite pattern manages the hierarchical relationship between ships and their sections, while the Strategy pattern allows dynamic selection of algorithms for finding available ships. Finally, the Observer pattern enables efficient notification of changes between dependent objects. Together, these patterns provide a robust framework for implementing the described system.
Tags