KINDLY ANSWER THIS ORDER FROM THE TUTOR’S VIEW POINT IS FINE THERE ARE FOUR HERE TO MAKE COMMENTS OR ANSWER THEM ALSO EACH ONE FOR 62 WIRDS ONLY THANKS FOR UNDERSTANDING!!! 1) Software design...

1 answer below »

KINDLY ANSWER THIS ORDER FROM THE TUTOR’S VIEW POINT IS FINE THERE ARE FOUR HERE TO MAKE COMMENTS OR ANSWER THEM ALSO EACH ONE FOR 62 WIRDS ONLY THANKS FOR UNDERSTANDING!!!




1)


Software design patterns (SDP) are a universal reusable and repeatable solution to problems that regularly occur with respect to software design. SDPs are a representation of best practices applied by top-of-the-line and experienced software developers of object-oriented programming. SDP do not represent a finished design that may be converted directly into programming code but a template detailing how a problem could be solved and such a solution used in different situations. In most cases, these solutions were acquired through experimentation (trial and error) by many software developers over a large period of time. In Object-oriented programming, SDP is a repository for certain objects descriptions, object classes to be used, their attributes, dependencies, and a generalized method to solving the problems. It is not unusual for more than one SDP to address one problem; such a collection of SDP is known as a pattern framework (“Design Patterns”, n.d; “Design Pattern”, n.d & “Pattern (design pattern)”, 2007).


If one visits a school of pottery and observes how pots are made, it will soon become apparent that certain patterns are being followed. It is known universally that a pot has a bottom, side, handles and a top. By reason of experience and application, potters know that these basic “patterns” make the art of pottery easier no matter the design and size of pot being made. This analogy applies to SDP. SDPs enhance speedy software development process through tested and proven development methods. Reusing SDPs help in the prevention of code related issues that might lead to bigger issues later in the development process and Improve the readability of code for architects and coders that understand those patterns. SDPs provide generalized solutions and are presented in formats that are not tied to specific problems and can be improved over time which makes them more robust and flexible than improvised designs (“Design Patterns”, n.d).


The first software design principle is:Single Responsibility Principle. It implies that a class, method in a class or a function should only perform one action. For instance, if a class is responsible for fetching user data from a database, it should not be burdened with displaying it as well.Second is the Open/Closed Principlewhich states that a module should be open for extension but closed for modification. This means that a module should be extensible with new features, not by changing its source code but instead by adding new code.The third principle is the Liskov Substitution Principleexpressed as “Let φ(x) be a property provable about objects x of type T. Then φ(y) should be true for objects y of type S where S is a subtype of T.” In software engineering terms it means a parent class should be substitutable with any of its child classed without breaking the system. This implies that implementation of the same interface should never produce a different result.The fourth principle is the Interface Segregation Principlewhich states that a client should never be forced to depend on methods it does not use. The goal of this principle is to reduce the aftermath and regularity of changes required by splitting the software into several independent parts.The fifth principle is the Dependency Inversion Principlewhich states that high-level modules should not depend on low-level modules but both should depend on abstractions. The general idea here is that high-level modules that provide complex logic should not be difficult to reuse and not be affected by changes that happen at low-level modules, that provide utility features. Abstraction that decouples the high-level and low-level modules from one another should be introduced to achieve this (Trajchevska, n.d; Janssen, 2018 & Janssen, 2018b).


There are three main categories of SDPs which are Creational, Structural and Behavioral design patterns. Generally these patterns save designers lots of time by being reusable and present methods of solving almost all thinkable software design problems. The different patterns however offer specific benefits to the software development world.


First we consider Factory Design Pattern (FDP) which falls under the Creational category of SDP. FDP allows objects creation without having to indicate the exact class of the object. Objects are created without exposing the logic of their creation to the client and the client uses the same common interface to create a new type of object. FDP has the following benefits: Allows sub-classes to choose the object type to create. Codes interact wholly with the resultant interface or abstract class such that it works with any classes that implement same interface (“Factory Method”, n.d; “Design Patterns | Set 2 (Factory Method)”, 2022).


Secondly, we consider Adapter Design Pattern (ADP) which falls under the Structural category of SDP. ADP functions like a bridge between two non-compatible interfaces. For instance, a card reader that acts as an adapter between memory card and a laptop. One of the benefits of ADP is that the code is reusable and flexible. Secondly, the code generated is considered clean since the client does not use a different interface in each concrete class, polymorphism can be used to swap between different adapters (“Design Patterns - Adapter Pattern”, n.d & Caballero, 2019).


Thirdly, the Strategy Design Pattern which falls under the Behavioral category of SDP. With this pattern, a class behaviour or its algorithm can be changed at run time. Some of the benefits offered by Strategy Design pattern is clean code because conditional-infested code can be avoided. It is also easy to switch between different algorithms in runtime (“Design Patterns - Strategy Pattern”, n.d & Caballero, 2019).




2)


The overhead for software design patterns are Creational, Structural, and Behavioral. Creational design pattern deal with creation and initialization. These patterns are used to create flexibility and to also help with reusing exiting codes. Structural patters assemble and place objects into larger structures. Behavioral patters help with communication and responsibilities between objects. All of these items help with the design, reuse, change, and implementation between the structures.





Explain the software design principles.


These are exceptions to the principles of software design however every one of these steps do not need to always be followed to complete for tasks during implementation. The term solid was derived by Robert Martin which names 5 design principles centered around better code design, maintainability, and extendibility. By following these terms it will help you maintain existing codes without breaking them, write codes that are easy to maintain, and also write codes that others can use and understand.


Single responsibility principle - Simple means that your class should do one thing


Open/Closed Principle - means that your module should be open for extension but, closed for modification


Liskov Substitution Principle- means you should be able to subtitle a parent class with any of it's child classes


Interface Principle - Never force a client to depends on methods that it does not use


Dependency inversion Principle- states that high level modules should not depend on low level modules.



S.O.L.I.D





Explain and provide use case examples of at least three design patterns. What is the benefit of each?


Singleton Design pattern is one of the easiest to use in JAVA. This type of design pattern comes from creational patterns and provides the best ways to create objects.


Bridge Design pattern is used when we need to decouple and abstract from its implementation so that the two can be independent.


Facade Design patter hides all the of the complexities and provides and interface to the client using so that the client can have access to the system. This type of pattern falls under structural designs.




3)


In software engineering, a software design pattern is a general, reusable solution of how to solve a common problem when designing an application or system. They are needed to support object-oriented programming (OOP), which is based on the concepts of both objects (instances of a class; data with unique attributes) and classes (user-defined types of data) (Singla, 2022).


Software design principles are a set of guidelines that helps developers make a good system design. They are based on object-oriented designed principles that are based on OOP. OOP Design Principles have 10 principles that can split into the following groups:



SOLID Principles: It is made up of five basic designs



Single Responsibility Principle (SRP)-a class should have one and only one reason to change, therefore, a class should have only one job.



Open/Closed Principle (OCP):
states that objects or entities (classes, functions, modules, etc.) should be open for extension but closed for modification.



Liskov Substitution Principle (LSP):
objects should be replaceable within the program with instances of their subtypes without changing the correctness of that program.



Interface Segregation Principle (ISP):states that Clients should not be forced to depend upon interfaces that they don’t use. It is needed to reduce the side effects and frequency of required changes by splitting the code into multiple/independent parts.



Dependency Inversion Principle (DIP):High-level modules must not depend on the low-level module, but they should depend on abstractions.



DRY(Don’t repeat yourself) principle: states that each small piece of knowledge (code) should only occur exactly once in the entire system.



KISS(Keep it simple, stupid!!) principle: keep each small piece of software simple, and unnecessary complexity should be avoided.



YAGNI(You ain’t gonna need it) principle: always implement things when they are needed and never implement things before you need them (Lee, 2020).


There are three types of design patterns. They are creational, structural, and behavioral.
Structural pattern (façade): In comparison to an architectural façade, this pattern solves the problem of covering up some complexity by hiding it behind a simpler layer. Therefore, it conceals a complicated interface—probably involving several different classes behind a simpler, unified interface (Beecher, 2017). For example, a customer orders food from a menu. The order goes to the kitchen staff in the back and food comes back after being cooked. The customer does not want to know all the detail (how long it takes to cook the steak, who will cut the steak, and who will wash the dishes). The customer just wants to eat the meal that he/she ordered. Therefore, the menu serves as the façade to make it easier for the customer by avoiding complexities within the kitchen and from the waiter making sure the order was correct.



Creational patterns:they are designed for class installation that are either class-creation patterns or object-creational patterns. The Singleton design pattern ensures a class only a single instance should be created, and a single object can be used by all other classes. It is composed of the following:


A private static variable, which holds the only instance of the class


A private constructor, it will not be instantiated anywhere else


A public static method, to return the single instance of the class



Behavioral patterns:
are based on how one class communicates with others. The Visitor pattern represents an operation to be performed on the elements of an object structure without changing the classes on which it operates. For example, the operation of a taxi company. A customer calls the taxi company (accepting visitor), the company will dispatch a taxi cab to pick up the customer, or Visitor, is no longer in control of his or her own transportation, the taxi (driver) is.



References


Beecher., K., 2017.Computational thinking: A Beginner's Guide to Problem-Solving and Programming. London: BCS.



4)


Software architecture refers to how an application or system is organized. It includes how each system component relates and communicates with each other. Software designers and developers use design patterns to create reusable solutions to computing problems.



Explain the concept and practical use of software design patterns.


What is software pattern?


In software development, a pattern (or design pattern) is a written reusable document that describes a general solution to a recuring design problem in many projects. It is more of a template to approach the problem at hand. (Singla, 2022) Design patterns areused with object-oriented programming paradigms which helps programmers to solve common object-oriented programming problems. The use of design patterns in software projects ensures a robust and bug free code. Design patter can be categorized into three broad types that are subdivided into many areas depending on the intent for their usage.



Creational Patterns: Creational Patterns are patterns that design the process of creating different objects. This pattern creates objects in a manner that is beneficial and efficient for a given situation by allowing the creation of objects without specifying their concrete type. It therefore deals with object creation and initialization, providing guidance about which objects are created for a given situation. Examples of this type of design pattern are factory method, abstract factory, builder, prototype, and singleton.



Structural Patterns: Structural Patterns are patterns that provide ways to create different relationships between classes and objects by specifying their structures. Under this pattern are adapter, bridge, composite, decorator, façade, flyweight, and proxy.



Behavioral Patterns: Behavioral Patterns identify common communication problems between different classes and try to come up with several solutions in order to fix such problems effectively and efficiently. Among the examples under this pattern are chain of responsibility, command, interpreter, mediator, memento, observer, state, strategy, visitor, and template method.



Explain the software design principles


Software development is a non-static process that keeps evolving in a constantly changing environment, and so are the principles behind these processes. Therefore, designing or structuring an application seeks to provide a seamless and extended way to meet this continuously changing expectations. Its success is therefore dependent on the impact of projected and actual successful software usability at system application.


Among the principles of software designs are.



Open/closed principle


This principle allows modules, classes, and functions to be opened for extension but not modification. (Packt n.d.) It requires a continuous usage of these modules and classes along with their functionalities that can only be expanded. Therefore, any addition to the content of a design must test its entire functions. As changes in one module might affect the functionality in others or overall, through the use of inheritance and polymorphism.



Liskov Substitution Principle


The proponent of this principle, Barbara Liskov recommends no rigid derived modules or classes. It rests on the premise that all derived classes must be able to be substituted with its supertypes from a behavioral point of view.



Interface Segregation Principle (ISP)


This principle exists to avoid a polluted interface where there are two contending interfaces where one is needed, and the other is not. ISP therefore seeks to remove the interface that is not needed, in essence, this principle revolves around the believes that "clients should not be forced to depend upon interfaces that they don't use."(oodesign, n.d.)


Interface segregation is necessary in design, but in the event of a robust network of interface, it is best to remove those that are unnecessary and not subject them to segregation. This is because applying more than necessary interface segregation will result in codes containing a lot of interfaces with single methods leading to pollution that ISP seeks to prevent. Therefore, its application should be based on experience and common-sense identification of the areas where extension of code is more likely to happen. It is probably the only way to reduces the code coupling, making the software more seamlessly robust, and easier to maintain and extend.



Dependency inversion principle


This principle concentrates more on structural superiority of modules through comparison. It states that "high-level modules should not depend on low-level modules. Both should depend on abstractions." () It therefore hinges its functionality on coupling which measures the degree to which modules of a software system are dependent on one another.



Explain and provide use case examples of at least three design patterns. What is the benefit of each?


Going by the three major types of design patterns listed in the first part of this discussion, examples from each three will be thus given.



Creational design pattern


These design patterns are used to increase flexibility and to reuse existing code. For example, the


Factory Methodcreates objects with a common interface and lets a class defer instantiation to subclasses, while


Abstract Factorydeals with the creation of a family of related objects.



Structural design pattern


This design pattern deals with class and object composition, or how to assemble objects and classes into larger structures. Examples are


Adaptershows a developer how to change or adapt an interface to that of another existing class. The befit of this is to allow incompatible interfaces to work together.


Proxyshows how developers can represent an object with another object to enable access control. This cuts cost and reduces complexity.



Behavioral design pattern


This design pattern is mainly concerned with communication between objects and how responsibilities are assigned between objects. This encourages step-by-step processes that must be sequentially executed. Examples under this are


InterpreterSupports the use of language elements within an application.


IteratorSupports iterative (sequential) access to collection elements. (Singla, 2022)




Answered Same DayJun 25, 2022

Answer To: KINDLY ANSWER THIS ORDER FROM THE TUTOR’S VIEW POINT IS FINE THERE ARE FOUR HERE TO MAKE COMMENTS OR...

Sudipta answered on Jun 26 2022
90 Votes
Comment 1
In the post, you mentioned that software design patterns (SDP) are the representation of
best practices that are being applied by top-of-the-line software developers. Here, you could have given some examples of top-of-the-line software developers. I really apricate that you have highlighted all the categories of SDPs which are creational, structural, and behavioral. Each of these categories has a different approach to SDP. 
Comment 2
I really appreciate that you have identified three of the overheads for software design patterns which are creational, structural, and...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here