Free Essay

Software

In:

Submitted By abhilash410
Words 1228
Pages 5
Assignment 1

Title :
Study any two patterns and SUBMIT a design pattern specification these in a standard format along with their UML diagrams. The specification must include Problem/ Issue, Audience/ Context, Forces, Solution, Discussion/ Consequences/ Implementation, Related Patterns, Example Instances, References.

Theory:
Introduction:
Creational design patterns abstract the instantiation process.they help make a system independent of how its objects are created,composed & represented.a class creational pattern uses inheritanceto vary the class that’s intiated,where as creational pattern will delegate instantiation to another object.creational pattern become important as systems evolve to depend more on object composition than class inheritance.as that happens,emphasis shifts away from hard-coding a fixed set of behaviors toword defining a smaller set of fundamental behaviours that can be composedinto any no. of more complex onces.thus creating objects with perticular behaviour requires more than simply instantiating a class.

Design patterns

“Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.”
[Christopher Alexander]

Design patterns capture the best practices of experienced object-oriented software developers.

Design patterns are solutions to general software development problems.

A pattern has four essential elements * Pattern Name * Problem * Solution * Consequences

Pattern Name: Is a handle we can use to describe a design problem, it’s solutions & consequences in a word or two. Naming a pattern immediately increases our design vocabulary. It lets us design at a higher level of abstraction.

Problem: It describes when to apply the pattern. It explains the problems and it’s context. It might describe specific design problems such as how to represent algorithms as objects. It might describe class or object structures that are symptomatic of an inflexible design.

Solution: Describes the elements that make up the design, their relationships, responsibilities and collaborations. The solution doesn’t describe a particular concrete design or implementation, because a pattern is like a template that can be applied in many different situations. Instead the pattern provides an abstract description of a design problem & how a general agreement of elements solve it.

Consequences: Are the results and trade-offs of applying the pattern. Though consequences are often unvoiced when we describe design decisions, they are critical for evaluating design alteration and for understanding the costs & benefits of applying the pattern.

Design patterns can be (roughly) grouped into three categories: * Creational patterns are ones that create objects for you, rather than having you instantiate objects directly. This gives your program more flexibility in deciding which objects need to be created for a given case.

* Structural patterns help you compose groups of objects into larger structures, such as complex user interfaces or accounting data.

* Behavioral patterns help you define the communication between objects in your system and how the flow is controlled in a complex program. The different design patterns are as follows: 1. Factory Method 2. Singleton 3. Adaptor 4. Façade 5. Proxy 6. Iterator 7. Mediator 8. Memento 9. Observer 10. Pipes and Filters

We will study two design patterns in this assignment.

1. The Factory Pattern

* Factory patterns are examples of creational patterns * Creational patterns abstract the object instantiation process. They hide how objects are created and help make the overall system independent of how its objects are created and composed. * Class creational patterns focus on the use of inheritance to decide the object to be instantiated.
Factory Method * Object creational patterns focus on the delegation of the instantiation to another object.
Abstract Factory

Intent Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

Motivation
Consider the following framework:

The createDocument() method is a factory method.

Applicability
Use the Factory Method pattern in any of the following situations: * A class can't anticipate the class of objects it must create * A class wants its subclasses to specify the objects it creates

Structure

Participants * Product
Defines the interface for the type of objects the factory method creates * ConcreteProduct
Implements the Product interface * Creator
Declares the factory method, which returns an object of type Product * ConcreteCreator
Overrides the factory method to return an instance of a ConcreteProduct

Collaborations * Creator relies on its subclasses to implement the factory method so that it returns an instance of the appropriate ConcreteProduct

So what exactly does it mean when we say that "the Factory Method Pattern lets subclasses decide which class to instantiate?"
It means that Creator class is written without knowing what actual ConcreteProduct class will be instantiated. The ConcreteProduct class which is instantiated is determined solely by which ConcreteCreator subclass is instantiated and used by the application.
It does not mean that somehow the subclass decides at runtime which ConreteProduct class to create
Clients can also use factory methods:

The factory method in this case is createManipulator()
Note that although the Client delegates the creation of a ConcreteManipulator to a ConcreteFigure object, the focus of the pattern is still on how a specific subclass of Figure creates one particular type of Manipulator. So this is still the Factory Method Pattern (a class creational pattern).

Class Diagram for Factory Pattern

Sequence Diagram for Factory Pattern

2. The Singleton Pattern In many systems, there should often only be one object instance for a given class * Print spooler * File system * Window manager
This pattern answers the question: How to design the class such that any client cannot create more than one instance of the class?
The key participants in this pattern are:
The Singleton, the class which only allows one instance to be created

Intent
Ensure a class only has one instance, and provide a global point of access to it

Motivation
Sometimes we want just a single instance of a class to exist in the system
For example, we want just one window manager Or just one factory for a family of products.
We need to have that one instance easily accessible And we want to ensure that additional instances of the class cannot be created.

Structure

Consequences * Benefits * Permits a variable number of instances * Controlled access to sole instance
As the constructor is protected, the class controls when an instance is created * Reduced name space
Eliminates the need for global variables that store single instances * Permits refinement of operations and representations
You can easily sub-class the Singleton * Permits a variable number of instances
The class is easily modified to allow n instances when n is not 1 * More flexible than class operations
This pattern eliminates the need for class (i.e. static) methods

We'll use a static method to allow clients to get a reference to the single instance and we’ll use a private constructor!

Singleton Implementation * Note that the singleton instance is only created when needed. This is called lazy instantiation.
Two instances of the singleton class could be created! * How could we prevent this? Several methods: * Make the instance() synchronized. Synchronization is expensive, however, and is really only needed the first time the unique instance is created. * Do an eager instantiation of the instance rather than a lazy instantiation.

Class Diagram for Singleton Pattern

Sequence Diagram for Singleton Pattern

Conclusion: In this assignment the study of Factory pattern and Singleton pattern is completed.

Similar Documents

Premium Essay

Software

...Principle of Software Engineering Table of Contents Abstract 3 Introduction 4 Boehm's First Law 4 Boehm's Second law 5 Conway's law 5 Parnas Law 6 Corbató Law 7 Observation 8 Theory 9 Law 9 Question 3 10 Law 11 References 12 Abstract The purpose of the study is to show the capability to understand the set of laws that are the part of principles of the software engineering. In this paper, it is discussed that there are many laws related to the software engineering but only few of them are to be addressed. Boehm first and second law, Conway’s laws, Parnas laws & Corbato law were discussed with examples. There are two relationship processes that are also discussed, related to the software Engineering. Law method and tools which are depended on each other and they are performing the task with the help of principle and process by following the rules. Same scenario is followed in other relation too, where observation, law and theory are depended on each other. Observation is repeatable to law and law is explained by theory. Theory should be confirmed by the law and it predict by the observation before further proceeding. Introduction Question No 1 Boehm's First Law Errors are more regular in the middle of fundamentals and configuration exercises and are more abundant when they are displaced. In this law, some basic configuration errors do outnumber code blunders. However, cost stays smooth...

Words: 1641 - Pages: 7

Free Essay

Software

...Identify two periodical publications that focus on software architecture (either solely or partly). Submit the following information: publication name, URL, publisher name, & the year it was first published. IEEE Potentials, First Publication Year: 1982 URL : http://ieeexplore.ieee.org/xpl/mostRecentIssue.jsp?punumber=45 Publisher Name: IEEE Xplore Msdn magazine First Publication Year: 2001 URL: https://msdn.microsoft.com/en-us/magazine/dn973005.aspx Publisher Name: The Microsoft journal for developers Write a half-page short essay comparing and contrasting software architects and software engineers. Software architect has responsibility for guaranteeing coherence of all aspects of the project as an integrated system. Architect answerable for overall technical quality, developer for lower implementation selections. The architect holds the futuristic views and proactively sees the system before it\'s designed, being the holder of the vision. Software architect focuses on money and also the disposition and drive to guide individuals. a leader who will apply/share their broad framework. Pragmatic handling of the technical solution and act with the business in addition as the techies, marketing the vision to each. A software architect has the vision to own the most effective style ideas. Architects will see each micro and macro (inwards and outward) whereas engineers see small and outwards and want to be carried by the architect to examine macro/outwards. Maintaining...

Words: 892 - Pages: 4

Premium Essay

Software

...Software Quality Assurance Software quality assurance Software quality assurance, often referred to in the industry as "software testing" or "QA testing" consists of thoroughly testing every aspect of a software project to ensure that: 1. It functions as intended and does not contain errors 2. It complies with the previously established development guidelines As the interactive software industry grows, software quality assurance has become more and more complicated. Many offshoots have arisen and considerably complicated the software testing jargon: security testing, unit testing, usability testing, load testing, scripted testing, compatibility testing, etc. In the end, what software quality assurance is all about is making sure that your software product works seamlessly for all your users. While we may expand into other areas in the future, we at the Crowdsourced Testing company specialize in one particular type of testing known as functional testing. The sad reality of software quality assurance The unfortunate reality of the software development industry is that testing is often neglected because development companies are under a tremendous amount of pressure to deliver their projects faster and faster. Furthermore, software programming is a complex endeavor and it is very difficult to know ahead of time exactly how much time will be needed to develop a particular project. What usually ends up happening is that programmers work until the very last minute available...

Words: 616 - Pages: 3

Free Essay

Software

...Robert P. Ward Software Engineering in the Small Smaller-sized software companies are developing significant products that need effective, tailored software engineering practices. n 1968, the NATO Software Engineering Conference in Garmisch, Germany [6] initiated the concept of software engineering, identifying the problems with producing large, high-quality software applications. In 1975, De Remer [2] introduced the terms, “programming in the small” and “programming in the large” to differentiate the development characteristics of large-scale software development from detailed programming (for example, data structures and algorithms). The principal source of large-scale software at the time was development contracts issued by the U.S. Department of Defense. Since then, virtually all software engineering literature has concentrated explicitly and implicitly on the model of DoD contract software development. Since the late 1970s, the microcomputer revolution has dramatically increased the quantity of software produced, the average I size of programs, and the number of companies involved in software development. Much more software is produced for internal use, commercial applications, and the mass-market than for deep-pocketed government and large industry. Using the number of units sold, mass-market software dwarfs the other forms of software sales. The growth of the software industry has produced many small companies that do not do contract software, but rather compete...

Words: 2136 - Pages: 9

Free Essay

Software

...Ariel M. Vasquez November 24, 2014 CIS331 System Modeling Theory Professor Randy Arvay Software System Architecture For this case the question is asked which system would be best to implement for this case. There are several different types of cases to chose from. They all with their own particular benefits and negatives at the same time The one that fits this needs in particular would be the event driven system. What is an event driven architecture system? An event driven architecture, or EDA for short, is a pattern that focuses on promoting production, detection, and consumption. Most of its works occur during an event. In the medical field, which this case revolves around, have thing change a lot during the course of not only a day even within every hour this change. Whether it's from a patient's medical records, stock of inventory, medicines provided to a patient, and even when a patient enters and exits the hospital. With a system like EDA thing will only occur when things change and this pattern seems to be able to handle those changes better than the others. The following image will show basically how this type of system will work. A system that integrates EDA may also provide a higher level of service to help with the implementation of EDA. Things like security, reliable messaging, content based routing, and mapping and transformation. The security that this provides is message encryption, authentication, and access control. With the messaging this provides...

Words: 418 - Pages: 2

Premium Essay

Software

...Software is a general term for the various kinds of programs used to operate computers and related devices. (The term hardware describes the physical aspects of computers and related devices.) Importance of Software Security Assurance As organizations worldwide increase their reliance on software controls to protect their computing environments and data, the topic of Software Security Assurance grows in importance. The tremendous potential costs associated with security incidents, the emergence of increasingly complex regulations, and the continued operational costs associated with staying up to date with security patches all require that organizations give careful consideration to how they address software security. For more information on Software Security Assurance, see Wikipedia on Software Security Assurance. Oracle Software Security Assurance Encompassing every phase of the product development lifecycle, Oracle Software Security Assurance (OSSA) is Oracle's methodology for building security into the design, build, testing, and maintenance of its products. Oracle's goal is to ensure that Oracle's products, as well as the customer systems that leverage those products, remain as secure as possible. Oracle Software Security Assurance is a set of industry-leading standards, technologies, and practices aimed at: • Fostering security innovations. Oracle has a long tradition of security innovations. Today this legacy continues with Oracle's market leading database security...

Words: 484 - Pages: 2

Free Essay

Software

...Five Models Of Software Engineering Nabil Mohammed Ali Munassar1 and A. Govardhan2 1 Ph.D Student of Computer Science & Engineering Jawahrlal Nehru Technological University Kuktapally, Hyderabad- 500 085, Andhra Pradesh, India Professor of Computer Science & Engineering Principal JNTUH of Engineering College, Jagityal, Karimnagar (Dt), A.P., India 2 Abstract This research deals with a vital and important issue in computer world. It is concerned with the software management processes that examine the area of software development through the development models, which are known as software development life cycle. It represents five of the development models namely, waterfall, Iteration, V-shaped, spiral and Extreme programming. These models have advantages and disadvantages as well. Therefore, the main objective of this research is to represent different models of software development and make a comparison between them to show the features and defects of each model. Keywords: Software Management Processes, Software Development, Development Models, Software Development Life Cycle, Comparison between five models of Software Engineering. increased recently which results in the difficulty of enumerating such companies. During the previous four decades, software has been developed from a tool used for analyzing information or solving a problem to a product in itself. However, the early programming stages have created a number of problems turning software an obstacle to...

Words: 3810 - Pages: 16

Free Essay

Hardware and Software

...Hardware and Software Paper CIS 205 Hardware and software play a very important role in business today and if combined together they can support personal, workgroup, and enterprise computing. In my organization we use Windows based computers for each workstation in each respective location. With the appropriate hardware networking the computers together, we are able to communicate through our network. In this case, we are a small business so we followed the steps necessary to map drives together in the various locations. The hardware needed for our network is a modem, router, Ethernet cables, external hard drives, and power supplies. The software we use to run our network is Windows. When used together this hardware and software help us operate our organization efficiently by easily sending and receiving information. We are able to navigate to any computer’s information in our company through this network. As a design, printing, and embroidery company, we use many online applications to help support and organize our information. The majority of our incoming business comes from the internet. I use an online application called Oss designer to download customer art, organize customers data, and obtain the necessary information from a customer to get the job done. We also use the Oss software to obtain payments for our services. In order to track customers we use an invoice and customer tracking program called Quickbooks. This software enables us to easily create invoices...

Words: 572 - Pages: 3

Free Essay

Escoger Un Software

...calendario para una presentación del software * Reunir a todo el equipo para la presentación del software. * Seleccionar 2 candidatos posibles. * Elegir el proveedor adecuado. Primero debemos recolectar la información de los posibles proveedores y de entre ellos escoger los 3 o 5 proveedores que se ajusten más a nuestros requerimientos. Después debemos reunirnos con cada uno de ellos para poder conversar y evaluar si pueden ser posible candidatos a para convertirse nuestro proveedor. Una vez que nos hemos reunidos pasamos a agendar una presentación del software con todos los empleados que van a utilizar el mismo para que se vayan familiarizando con este. Una vez que hayamos realizado el análisis del posible proveedor y lo hayamos escogido, pasamos a la firma del contrato con el proveedor bajo los términos y condiciones pactadas entre las partes. * Proporcionar información para la personalización de aplicaciones de gestión. Debemos proporcionar cualquier información útil para el equipo: manual de políticas y procedimientos, informes clave, el acceso al sistema actual y para que de esta forma el proveedor sea más exacto con el software que vamos a usar para operar nuestra empresa. * Análisis y la firma del documento DERCA. Este documento es donde especificaremos los requerimientos de nuestra empresa como los procesos del sistema, las interfaces de entrada y los conectores de salida, como tomamos la decisión de usar un canned software tenemos...

Words: 1063 - Pages: 5

Free Essay

Hardware Software

...HARDWARE AND SOFTWARE PAPER Hardware and Software Paper Nathen Hill University of Phoenix Introduction Here at D & G Inc. we are a shipping and receiving company. We sell just about everything, we are a middle man company for several online stores. When you purchase a products online like a DVD the company you purchase through invoices D & G Inc. and we ship the product via UPS to you. At D & G Inc. the Hardware we use a basic Dell Computers running Windows XP. We have about thirty computers in the warehouse and offices. We use Telzall scanning devices to scan and keep track of all merchandise in the warehouse. Without the proper hardware and software tools, the job of keeping track of tens of thousands of products would be a much more time consuming, and need many more employees to accomplish correctly . Hardware and Software The software we use here at D & G Inc. is the most important part of smooth operations. The software we use was created for us at D & G Inc. The system is called SMART it connects all of our databases together. The SMART system makes easy access to any database through, one of the dell computers or through the handheld Telzall scanners. The SMART system runs the time clocks to keep track of all employee hours. First you scan in your ID badge in to the time clock provided on the wall next to all exits. Once you are scanned in to the SMART system you are allowed to log in to the database...

Words: 708 - Pages: 3

Free Essay

Hardware and Software

...Hardware and Software Name Professor Name Name of Class Hardware and Software Here at Enterprises we are a shipping and receiving company. We sell just about everything; we are a middleman company for several online stores. When you purchase products online like a DVD the company you purchase through invoices Enterprises and we ship the product via UPS to you. At Enterprises the Hardware we use a basic Dell Computers running Windows XP. We have about thirty computers in the warehouse and offices. We use Telzall scanning devices to scan and keep track of all merchandise in the warehouse. Without the proper hardware and software tools, the job of keeping track of tens of thousands of products would be a much more time consuming, and need many more employees to accomplish correctly. Hardware and Software The software we use here at D & G Enterprises is the most important part of smooth operations. The software we use was created for us at Enterprises. The system is called SMART it connects all of our databases together. The SMART system makes easy access to any database through, one of the dell computers or through the handheld Telzall scanners. The SMART system runs the time clocks to keep track of all employee hours. First you scan in your ID badge in to the time clock provided on the wall next to all exits. Once you are scanned in to the SMART system you are allowed to log in to the database and access information you need to perform your...

Words: 698 - Pages: 3

Free Essay

Hardware and Software

...Hardware and Software Your Name Date Class Name Teacher’s name The system that best resembles the hardware and software used at the nursing home located in PA that I used to work for is the Power Macintosh 9500. According to Wikipedia.org, the system was sold between 1995 through 1997 and has the following hardware installed, “It was powered by a PowerPC 604processor, a second-generation PowerPC chip which was faster than the earlier PowerPC 601 chip. The 180MP and 200 used the enhanced PowerPC 604e processor. The CPU was connected via a daughterboard, and so could be swapped easily. Available were single-processor cards ranging from 120 to 200 MHz, and a dual processor card with two 180 MHz CPUs. It was the first Macintosh to use the PCI standard, with six PCI slots available, with one always needed for the graphics card.” The exact breakdown of system hardware can be seen at the Apple website at the following link, http://support.apple.com/kb/SP492. The overall operations of the system are great for its age and can even be enhanced with a new program entitled “Leopard” (also available from Apple) that could help the overall performance of the system and was actually the oldest model that is compatible with that program. As for the software, we all know that there are significant differences between workgroup, personal, and enterprise uses such differences can be seen with the different programs each use has to offer, some examples of the differences are business...

Words: 847 - Pages: 4

Premium Essay

Software

... Chinyere repper. Software for Business. MS PROJECT (PROJECT PLANNING) Microsoft Project is a project management software program, developed and sold by Microsoft, which is designed to assist a project manager in developing a plan, assigning resources to tasks, tracking progress, managing the budget, and analyzing workloads. Microsoft Project was the company's third Microsoft Windows-based application, and within a couple of years of its introduction it became the dominant PC-based project management software. While part of the Microsoft Office family, it has never been included in any of the Office suites. It is available currently in two editions, Standard and Professional. Microsoft Project's proprietary file format is mpp. Microsoft Project and Microsoft Project Server are the cornerstones of the Microsoft Office Enterprise Project Management (EPM) product. Microsoft Project 2010 features the Ribbon user interface. Microsoft Project management software is closely integrated with Microsoft Office suite and also includes a Client Access License (CAL) that allows easy connection with Office Project Server. It is a project management software that is mainly used to create plans, monitor progress, analyze workloads, designate resources to tasks and manage budgets. The software also helps in establishing critical path schedules and may also be helpful...

Words: 841 - Pages: 4

Premium Essay

Computer Software

...Computer software From Wikipedia, the free encyclopedia Jump to: navigation, search "Software" redirects here. For other uses, see Software (disambiguation). Computer software, or just software, is a collection of computer programs and related data that provide the instructions for telling a computer what to do and how to do it. In other words, software is a conceptual entity which is a set of computer programs, procedures, and associated documentation concerned with the operation of a data processing system. We can also say software refers to one or more computer programs and data held in the storage of the computer for some purposes. In other words software is a set of programs, procedures, algorithms and its documentation. Program software performs the function of the program it implements, either by directly providing instructions to the computer hardware or by serving as input to another piece of software. The term was coined to contrast to the old term hardware (meaning physical devices). In contrast to hardware, software is intangible, meaning it "cannot be touched".[1] Software is also sometimes used in a more narrow sense, meaning application software only. Sometimes the term includes data that has not traditionally been associated with computers, such as film, tapes, and records.[2] Examples of computer software include: * Application software includes end-user applications of computers such as word processors or video games, and ERP software for groups of...

Words: 3223 - Pages: 13

Premium Essay

Software Licence

...Autodesk SOFTWARE LICENSE AGREEMENT Worldwide READ CAREFULLY: AUTODESK, INC. (“AUTODESK”) LICENSES THIS SOFTWARE TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS SOFTWARE LICENSE AGREEMENT (“AGREEMENT”). BY SELECTING THE “I ACCEPT” BUTTON BELOW THIS AGREEMENT OR BY INSTALLING, UPLOADING, ACCESSING, OR OTHERWISE COPYING OR USING ALL OR ANY PORTION OF THE SOFTWARE YOU AGREE TO BE LEGALLY BOUND BY THIS AGREEMENT. A CONTRACT IS THEN FORMED BETWEEN AUTODESK AND EITHER YOU PERSONALLY, IF YOU ACQUIRE THE SOFTWARE FOR YOURSELF, OR THE COMPANY OR OTHER LEGAL ENTITY FOR WHICH YOU ARE ACQUIRING THE SOFTWARE. IF YOU DO NOT AGREE OR DO NOT WISH TO BIND YOURSELF OR THE ENTITY YOU REPRESENT: (A) DO NOT INSTALL, UPLOAD, ACCESS, OR OTHERWISE COPY OR USE THE SOFTWARE; (B) SELECT THE “I REJECT” BUTTON BELOW THIS AGREEMENT (WHICH WILL CANCEL THE LOADING OF THE SOFTWARE); AND (C) WITHIN THIRTY (30) DAYS FROM THE DATE OF ACQUISITION, RETURN THE SOFTWARE AND ANY ACCOMPANYING DOCUMENTATION AND MATERIALS TO THE COMPANY FROM WHICH YOU ACQUIRED THE SOFTWARE FOR A REFUND. INSTALLATION, UPLOADING, ACCESS, OR OTHER COPYING OR USE OF THIS SOFTWARE OR ANY ACCOMPANYING DOCUMENTATION OR MATERIALS EXCEPT AS PERMITTED BY THIS AGREEMENT IS UNAUTHORIZED AND CONSTITUTES A MATERIAL BREACH OF THIS AGREEMENT AND AN INFRINGEMENT OF THE COPYRIGHT AND OTHER INTELLECTUAL PROPERTY RIGHTS IN SUCH SOFTWARE, DOCUMENTATION AND MATERIALS. IF YOU INSTALL, UPLOAD, ACCESS, OR OTHERWISE COPY...

Words: 6081 - Pages: 25