logo

Software Engineering Order Assignment

Creating a Scrapbooking Application using the Android mobile operating system.

12 Pages2215 Words23 Views
   

Added on  2022-08-10

About This Document

Assignment: Software Engineering Order -APA 6th Edition (Please use the template that is attached)*** -Strong intro (i.e., thesis statement) and conclusion needed in the assignment -No peer to peer/reference material over six years old -Please use the full page because my professor is a stickler for that kind of thing -Please understand this is a critical thinking assignment, and there shouldn't be any: This essay or assignment will cover ... etc. -Strong grammar is needed in this assignment. -Please be through with this (i.e., use examples and attach screenshots) because if you do not, then the professor will have follow-on questions -Clarify what each abbreviation represents; for instance, LOL (Laugh out Loud) -This is a two-part assignment, where there is a written part (i.e., report) and a technical part. -Please make sure that the writer uses Visual Studio to complete the order __________ Title: Singleton Design Pattern For this 

Software Engineering Order Assignment

Creating a Scrapbooking Application using the Android mobile operating system.

   Added on 2022-08-10

ShareRelated Documents
Software Engineering Order Assignment: Singleton Design Pattern
1
Software Engineering Order Assignment: Singleton Design Pattern
Student
Course
Instructor
Date
Software Engineering Order Assignment_1
Software Engineering Order Assignment: Singleton Design Pattern
2
Software Engineering Order Assignment: Singleton Design Pattern
In computer programming, with certain software it is preferred to limit the data class to one
instance only so that the only defined instance is held responsible in terms of coordinating the
actions across the system. The key idea is to let the class itself create only one instance with
the help of a private constructor which however, can be returned by a publicly defined
getInstance() method.
Background
The singleton pattern one of Gang of Four Design Pattern creational design patterns. (Lahoti,
2018)With the help of such a design pattern, the connection is limited to only one underlying
active entity rather than let every reader mere be a part of multiple instances of the legacy
data. These patterns are used for logging, driver objects, caching and thread pool, database
connections (Rai, n.d.). Therefore, the patterns like singleton patterns are useful in
applications like representation of an abstract factory, where you lock the information and
only the specified information is visible for a customer. Such patterns are also proven to be
helpful in designing the prototype patterns.
Development Platform
From implementation point-of-view, consider the globally defined singletons since they don’t
occupy much memory in the namespace. The instance should be private and static so that an
instance is only created when a variable is initialized. Furthermore, it becomes impossible to
know in which order the variables will be instantiated or destroyed. For a singleton class to
be instantiated, either the eager approach can be used in order to have a safe and easy use of
instance or the other one is the lazy initialization. However, it is very famous among these
pattern implementations to be initialized in a lazy manner, that means a static method should
Software Engineering Order Assignment_2
Software Engineering Order Assignment: Singleton Design Pattern
3
be invoked firstly. This generates a safety thread issue especially for multi-threading. It is
possible for any two threads to request for an access to the same instance at the same time.
By all means, the use of pointers can initiate the use of heap for the instance fields for the
memory allocation and the performance issues are therefore tackled with the help of the lazy
initialization. It is also noted that the variables defined with the help of this approach prevent
any external class from creating new instances. It guarantees uniqueness of initialization of
function scope objects to be initialized in a synchronized manner (Jarold, n.d.). Once a
singleton is created and destroyed, there will be no leak. Overall, the singleton pattern is a
good entry point for the design world as it encapsulates the data while ensuring the thread
safety, but it is still not useful in all situations, as some programming critics believe the idea
to be an anti-pattern, in other words it is a counter-productive pattern while it comes to
practice
Design
Part i. UML diagram for Leader Project.
In this UML diagram, a Leader is demonstrated using a singleton pattern, that means there is
only one private object named _instance. The following instance can call its class functions
more than once hence what the arrow indicates. Moreover, the constructor is also set private
with two other public methods getInstance() and giveSpeech(). In the end, a UML notation
Software Engineering Order Assignment_3
Software Engineering Order Assignment: Singleton Design Pattern
4
denotes the extended notation of OMT (Object Modeling Technique) for explaining the
principles of diagram.
Part ii. Exploring the Leader project.
For This program to work, the understanding of the flow of events is required. Following
scenario explains what is happening within this code.
Figure 1:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Code Preview
The instance is initialized to a Leader class statically with the help of a leader pointer that
also acts as an object for this class.
Figure 2:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Code Preview
The object being equivalent to an instance is explicitly initialized to NULL while keeping it
private.
In the main function,
Figure 3:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Code Preview
By compiling this line of code, an object of Leader class is created along with calling its
constructor at same time since a constructor is called automatically when an instance is
invoked.
Software Engineering Order Assignment_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
System Design Analysis Using UML PDF
|5
|950
|81

Software Engineering - Singleton Pattern
|5
|538
|412

Victorian Institute Of Technology - VIT Intro
|5
|831
|15

IMPROVEMENT OF TRANSACTION RELATED TO BUSINESS ASSIGNMENT 2022
|8
|590
|28

Software Engineering Analysis and Design
|11
|1955
|65

System Analysis and Design
|26
|4303
|348