Question

good day to you i need a full explanation in Software Construction, Design and Architecture for...

good day to you

i need a full explanation in Software Construction, Design and Architecture for these

Design Patterns

  • Creational
  • Structural
  • Behavioral
  • Concurrency

Homework Answers

Answer #1

Software Construction, Design and Architecture for Design Patterns

Creational

These design patterns are all about class instantiation or object creation. These patterns can be further categorized into Class-creational patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.

Creational design patterns are:

  • Abstract Factory: Creates an instance of several families of classes
  • Builder: Separates object construction from its representation
  • Factory Method: Creates an instance of several derived classes
  • Object Pool: Avoid expensive acquisition and release of resources by recycling objects that are no longer in use
  • Prototype: A fully initialized instance to be copied or cloned
  • Singleton: A class of which only a single instance can exist.

Example-

Suppose a developer wants to create a simple DBConnection class to connect to a database and wants to access the database at multiple locations from code, generally what developer will do is create an instance of DBConnection class and use it for doing database operations wherever required. Which results in creating multiple connections from the database as each instance of DBConnection class will have a separate connection to the database. In order to deal with it, we create DBConnection class as a singleton class, so that only one instance of DBConnection is created and a single connection is established. Because we can manage DB Connection via one instance so we can control load balance, unnecessary connections, etc.

Structural
These design patterns are about organizing different classes and objects to form larger structures and provide new functionality.

Structural design patterns are:

  • Adapter: Match interfaces of different classes
  • Bridge: Separates an object’s interface from its implementation
  • Composite: A tree structure of simple and composite objects
  • Decorator: Add responsibilities to objects dynamically
  • Facade: A single class that represents an entire subsystem
  • Flyweight: A fine-grained instance used for efficient sharing
  • Private Class Data: Restricts accessor/mutator access
  • Proxy: An object representing another object

Example-

When 2 interfaces are not compatible with each other and want to make establish a relationship between them through an adapter its called adapter design pattern. Adapter pattern converts the interface of a class into another interface or classes the client expects that is adapter lets classes works together that could not otherwise because of incompatibility. so in these type of incompatible scenarios, we can go for the adapter pattern.

Behavioral
Behavioral patterns are about identifying common communication patterns between objects and realize these patterns.

Behavioral patterns are:

  • Chain of responsibility: A way of passing a request between a chain of objects
  • Command: Encapsulate a command request as an object
  • Interpreter: A way to include language elements in a program
  • Iterator: Sequentially access the elements of a collection
  • Mediator: Defines simplified communication between classes
  • Memento: Capture and restore an object's internal state
  • Null Object: Designed to act as a default value of an object
  • Observer: A way of notifying change to a number of classes

Example-

Template pattern defines the skeleton of an algorithm in an operation deferring some steps to sub-classes, Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm structure. say for an example in your project you want the behavior of the module can be extended, such that we can make the module behave in new and different ways as the requirements of the application change, or to meet the needs of new applications. However, No one is allowed to make source code changes to it. it means you can add but can’t modify the structure in those scenarios a developer can approach template design pattern.

Concurrency Patterns

The choice of concurrency architecture has a significant impact on the design and performance of multi-threaded networking middleware and applications. No single concurrency architecture is suitable for all workload conditions and hardware and software platforms.

Concurrency Patterns are:

  • Active Object: The Design pattern decouples method execution from method invocation. Its purpose is to enhance concurrency and simplify synchronized access to objects that reside in their own threads of control
  • Monitor Object: The design pattern synchronizes concurrent method execution to ensure that only one method at a time runs within an object. It also allows an object's methods to schedule their execution sequences cooperatively.
  • Half-Sync/Half-Async: The architectural pattern decouples asynchronous and synchronous processing in concurrent systems, to simplify programming without reducing performance undudly.
  • Leader/Followers: The architectural pattern provides an efficient concurrency model where multiple threads take turns to share a set of event sources to detect, demultiplex, dispatch, and process service requests that occur on the event sources.
  • Thread-Specific Storage: This design pattern allows multiple threads to use one `logically global' access point to retrieve an object that is local to a thread, without incurring locking overhead on each access to the object.
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You are required to design a QoS architecture video conferencing application. Firstly, you will need to...
You are required to design a QoS architecture video conferencing application. Firstly, you will need to elaborate the QoS requirements of your application, and then you are required to provide an application design based on Integrated Services (IntServ) and Differentiated Services (DiffServ). The design must include how you can provide these services to your application over network devices (local routers, core networks and switches, etc.). After presenting the design, state your opinion which QoS architecture is easier to implement over...
Please, I need full explanation and correct answer. 9) In a country with a working-age population...
Please, I need full explanation and correct answer. 9) In a country with a working-age population of 22 million, 16 million are employed, 2 million are unemployed, and 1 million of the employed are working part-time, half of whom wish to work full-time. If 500,000 of those unemployed are cyclically unemployed, what is the natural unemployment rate?   9) _______ A) 5.6 percent B) 9.4 percent C) 8.3 percent    D) 11.1 percent E) 1.5 percent
Good day, I am working on a design for speed brake power generator and am struggling...
Good day, I am working on a design for speed brake power generator and am struggling with the calculations to decide on rack and pinion mechanism that will generate electricity when a car of about 1500kg drives over the speed brake. I also have to consider corrosion of the parts, so was looking at using stainless steel rather than carbon steel. Your assistance is highly appreciated.
Hi, I need an explanation and Excel's formulas for these answers in this. Thank you. On...
Hi, I need an explanation and Excel's formulas for these answers in this. Thank you. On November 30, 20X1 ABC corporation borrows $72,000 from the bank by signing a 60 day, 5% note agreement. Round values to 2 decimal places. Calculate the interest that should be accrued on this note at December 31, 20X1. Answer: 310 How much is the debit to Interest expense on the maturity date of the note assuming ABC corporation pays as agreed. Ans: $290
I need full solution Design a circuit with the specifications bellow: 1. The circuit contains at...
I need full solution Design a circuit with the specifications bellow: 1. The circuit contains at least two of each components: DC Voltage source, DC Current source, 2. The circuit contains at least 8 Resistors 3. One of the voltage sources is connected between ground and a non-ground node 4. One of the voltage sources is connected between two non-ground nodes 5. Make sure you need to solve at least 3 equations and 3 unknowns. After you designed the circuit:...
evaluate design, analyze and obtain results using digital simulation software Sample Projects: • Musical piano (full...
evaluate design, analyze and obtain results using digital simulation software Sample Projects: • Musical piano (full octave) including 7 programmed notes • Digital Clock with selection 12/24 hours and weekday • Two way traffic light with pedestrian crossing • Train controls and operation across two stations • Elevator controls and operation What is the problem you are solving? • Why is it interesting and who would use it when solved? • What leads you to this design? • Which techniques...
What is the Scientific method? ( i need very good EXAMPLES thank you)
What is the Scientific method? ( i need very good EXAMPLES thank you)
What is the difference between Search and Research? ( i need very good EXAMPLES thank you)
What is the difference between Search and Research? ( i need very good EXAMPLES thank you)
I couldn't take part in this team design project due to some emergency, I need to...
I couldn't take part in this team design project due to some emergency, I need to write a report about it today, so I need help with these questions. You can answer it according to your point of view. Reflect on your team design project( Car seat snugness indicator) and answer several of the following topics in essay form: What aspects of your design project did you find the most rewarding? Challenging? Fun? Discuss any engineering skills you learned or...
what is the good option in IKEA sustainity case study. i need to analyze each option...
what is the good option in IKEA sustainity case study. i need to analyze each option and find the good option. i need reason why that is the good option?Thank you
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT