Victorian Institute of Technology
Master of Information Technology & Systems
MITS4002
OBJECT-ORIENTED SOFTWARE DEVELOPMENT
(Research Study)
Submitted to: Submitted by :
Research Study
#Question 1
Contents
Research
The Creational Design Patterns
A creational design pattern describes how object s are created. They are meant to ease complexities as well as instability through creating objects within a manner which is controlled. In most cases, new operators are deemed to be harmful since it scatters every object over all the applications. With time, it comes to turn out to be challenging in transforming implementation since classes are known to be coupled tightly (Pressman, 2005). Creational design patterns are meant to address issues through decoupling customers as of the actual process of initiation. There are forms of creational design pattern. These include singleton, builder, abstract factory and factory method.
The Object Pool Design Method
This is a creational design pattern which is used in setting initialized objects which are made ready to be used in place of allocating alongside destroying them when the demand arises. The customer of a pool shall be requesting abject from a particular repository to carry out operations on the object which has been returned. When the client is done, then such object is returned in instead of destroying it. This is done automatically or manually.
The Singleton Design Method
Singleton design pattern makes sure that only a single instance of an object can exist all through the application. This pattern aims to keep checking on object initialization of certain classes through making sure that only a single example of an object can be existing all through Java Virtual Machine. Also, a class of singleton offers one exceptional global access points towards an object to make every succeeding call towards the returns of the only access point of particular objects. Even though GoF started the singleton pattern, the initial enactment is considered to be challenging within multithreaded circumstances (Pressman, 2005). Just as global variable, singleton pattern permits one to access an object as of any point within the program. Nonetheless, the singleton is safeguarding such instance so that other codes can never overwrite it. Every implementation of singleton follows these two necessary steps:
- Making default constructors private, thus averting other objects as of using new operators possessing singleton class.
- Creating a stationary approach acts as a constructor. Further down the hood, this approach calls private constructors in creating objects and saving them in static fields. The calls in this pattern often return cached objects.
The Factory Design Method:
Factory method is meant to create objects having many associated classed exclusively of stipulating the precise which is supposed to be created. It offers an interface in support of creating objects within superclass. However, it permits subclasses in altering the forms of objects which shall be established. When creating an application for logistic management, then the initial version of the app can only be handling transportation through trucks. Therefore, the bulk of the code often stays within the truck class. For a while, the application turns out to be pretty famous. Every day you get multiple requests as of sea transportation to include into the app sea transportation. In this problem, coding is coupled with truck class. In adding ships into this application would need some changes to be effected in the whole codebase. Furthermore, when the programmer decides to add another form of transportation into the app, then probably it will call for these changes to be effected. Consequently, the programmer ends up having pretty disgusting code, perforated with restrictions switching the behaviours of the application relying on the class for transporting objects.
When do we need the Factory Design Pattern?
Factory method is needed when the programmer does not know in advance the exact forms as well as to object dependencies of the code which should be put into work. In this case, this pattern is separating product construction code as of the code, which primarily employs the product. For that matter, it is easier for the programmer to extend independently code of product construction as of the other codes. For instance, when adding a new type of a product to an application, then there is a need to design fresh subclass creator as well as supersede the factory method within the app. Again, the factory method can be used when one needs to provide the user with the library otherwise frameworks having the approach of extending its component internally.
The Prototype Design Method
This is a creational design pattern which enables one to copy objects existing without making codes to rely on the classes. Suppose a programmer has an object, then he would be capable of creating the same copy just like it. This is done by creating a new object of a similar class. Then after that, the programmer goes through every field of an original object alongside copying their values over the new objects. The prototype pattern is delegating cloning processes towards actual objects which are being cloned. It is declaring standard interfaces in support of object which supports the operation of cloning. Th interface allows one to clone an object exclusive of coupling the codes addressing the class of such objects. In most cases, such an interface has one clone approach. The implementation process of this cloning approach is the same in every class. The Builder Design Method
Object is a sequence of steps. This builder class is independent of other objects. Builder is described as creational design patent which permits one to construct multifaceted objects stepwise. This pattern is allowing the programmer to create various forms as well as representations of objects through the use of similar codes of construction. The pattern gives suggestions to the programmer when it comes to extracting object construction codes from its class as well as moving it towards a distinctive object known as builders.
Real-Time Example of Builder Design Pattern
A real-time scenario of Builder Design Pattern can be seen in this example. Suppose one builder needs to construct everything from glass and wood and the other one needs to build all the things using stones and iron. The third one wants to do his construction through the use of diamonds and gold. Through calling a similar set of procedures, then it is possible to acquire a regular house from the first constructor. The second builder will end up with the castle as the third shall own a palace ultimately. However, all these would be working when the client code, which is used in calling steps of the building is capable of interacting with builders through the utilization of standard interfaces.
References:
Pressman, R.S., 2005. Software engineering: a practitioner’s approach. Palgrave Macmillan.
Research Study
#Question 2
Suggested design pattern: Template Design Pattern
THE ADVANTAGES OF TEMPLATE DESIGN PATTERN
This form of the pattern offers the following merits
In this pattern, there is no duplication of codes
In most cases, there is code reuse since it is employing inheritance but not compositions. There are only a few approaches which require to be overridden.
The flexibility makes subclasses to make decisions on how to implement algorithm steps.
Security Design Patterns
These are applicable in attaining goals within the security area. Every classical design pattern has various instantiation for fulfilling different information security goals. These might include integrity, availability and confidentiality. Besides, one can make fresh design mainly to attain come security goals. The security design pattern for the template can be authentication enforcer pattern which is employed in managing and delegating all the processes of authentications (Pressman, 2005).
Checkout
Suggested design pattern: Chain of responsibility design pattern
THE ADVANTAGES OF CHAIN OF RESPONSIBILITY DESIGN PATTERN
This is separating the sender of any particular request with the receiver. It assists in avoiding coupling of receivers and requesters. What is more, the pattern permits the application to be passed along the chain toward different objects which have the opportunity of knowing who sent a request. Thus, it bars coupling between the requester and receiver. This is advantageous since any object has the capacity of submitting a request to objects which are handling it. Besides, the handle requests could be changed to make more objects to be included to process all the incoming requests. Thus, transformations can be made in the handlers of requester and applications without disrupting the whole system.
Security Design Patterns
The best security pattern here is error detection. This has the duty of deducing errors and probably doing correction for them to guarantee accurate information exchange otherwise storage.