Sie sind auf Seite 1von 17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Chapter 1
Introducing Object-Oriented Analysis and Design
Software systems for enterprises need to be designed after an in-depth analysis. As software systems become more and more complex, it becomes increasingly difficult to correctly analyze the requirements and convert them into an appropriate design. Therefore, tools are required to deal with this complexity. ObjectOriented Analysis and Design (OOAD) provide you the necessary tools to analyze and design complex software systems. This chapter introduces the various phases of the Software Development Life Cycle (SDLC) and discusses the various software development approaches. Then, it discusses the object-oriented concepts and explains the role of OOAD in software development.

Objectives
In this chapter, you will learn to: Identify the various software development approaches Identify the role of OOAD in SDLC

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

1/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Understanding Software Development Life Cycle (SDLC)


Before the acceptance of software development as an engineering stream, the process of developing software was an ad hoc activity with no formal rules or standards. As a result, software projects faced serious problems in terms of schedule slippage, cost overrun, and inferior quality of software. SDLC was introduced to address the problems faced during the software development process. SDLC is a disciplined and systematic approach that divides the software development process into various phases, such as requirement analysis, design, and coding. The phase-wise development process helps you track schedule, cost, and quality of the software projects.

Overview of SDLC Phases


There are six phases in SDLC: Feasibility analysis : Includes analysis of project requirements in terms of input data and desired output, processing required to transform input into output, cost-benefit analysis, and schedule of the project. The feasibility analysis also includes the technical feasibility of a project in terms of available software tools, hardware, and skilled software professionals. At the end of this phase, a feasibility report for the entire project is created. Requirement analysis and specification: Includes gathering, analyzing, validating, and specifying requirements. At the end of this phase, the Software Requirement Specification (SRS) document is prepared. SRS is a formal document that acts as a written agreement between the development team and the customer. SRS acts as input to the design phase and includes functional, performance, software, hardware, and network requirements of the project. Design: Includes translation of the requirements specified in the SRS into a logical structure that can be implemented in a programming language. The output of the design phase is a design document that acts as an input for all the subsequent SDLC phases. Coding: Includes implementation of the design specified in the design document into executable programming language code. The output of the coding phase is the source code for the software that acts as input to the testing and maintenance phase. Testing: Includes detection of errors in the software. The testing process starts with a test plan that recognizes test-related activities, such as test case generation, testing criteria, and resource allocation for testing. The code is tested and mapped against the design document created in the design phase. The output of the testing phase is a test report containing errors that occurred while testing the application. Maintenance : Includes implementation of changes that the software might undergo over a period of time, or implementation of new requirements after the software is deployed at the customer location. The maintenance phase also includes handling the residual errors that may exist in the software even after the testing phase.

Software Development Approaches


Different types of projects have different requirements. Therefore, it may be required to tailor the SDLC
www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm 2/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

phases according to the specific needs of the project. This gives rise to various software development approaches. Some of these approaches are: Waterfall approach Prototyping approach Spiral approach Win-win spiral approach Incremental approach

Waterfall Approach
The waterfall approach describes the software development process in a linear sequential flow. This means that any phase in the development process begins only if the previous phase is complete. The waterfall approach does not define the process to go back to the previous phase to handle changes in requirement. Therefore, different projects may follow different approaches to handle such situations. The waterfall approach is the earliest approach that was used for software development. Initially, most projects followed the waterfall approach because they did not focus on changing requirements. The waterfall approach defines the software development process in seven phases: Conception: Triggers when a problem is perceived. This phase involves identifying goals to be achieved after the problem is solved, estimating benefits in the new system over the current system, and identifying other areas that are affected by the solution. This phase also involves developing the business case for the project. A business case provides the information that a manager needs to decide whether to support a proposed project, before resources are committed to its development. Initiation: Involves a macro level study of the customer requirements. This phase also involves defining alternative solutions to the customer requirements and cost-benefit justification of these alternatives. Analysis : Involves carrying out a detailed study of the customer requirements and arriving at the exact requirements of the proposed system. The phase involves freezing the requirements before the design phase begins. Design: Involves translating the identified requirements into a logical structure, called design that can be implemented in a programming language. Construction: Involves converting the design into a machine-readable form. Integration and testing: Involves integrating and testing all the modules developed in the previous phase as a complete system. Implementation and maintenance : Involves converting the new system design into operation. This may involve implementing the software system and training the operating staff before the software system is functional. The following figure shows the various phases in the waterfall approach.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

3/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

The waterfall approach assumes that requirements are stable and frozen across the project plan. However, this is usually not true in case of large projects where requirements may evolve across the development process.

Prototyping Approach
The prototyping approach, also known as evolutionary approach, came into picture because of failures that occurred in the final version of the software application developed using waterfall approach. The failures generally occurred because of the change in requirements of the proposed system or because of the gap in understanding the customer requirements by the development team. A gap in the first version of a developed application, inevitably leads to the need for redoing the application. To overcome these limitations, the concept of prototyping was introduced. A prototype is a sample implementation of the system that shows limited and main functional capabilities of the proposed system. After a prototype is built, it is delivered to the customer for evaluation. The prototype helps the customer determine how the features will function in the final software. The customer provides suggestions and improvements on the prototype. The development team implements the suggestions in the new prototype, which is again evaluated by the customer. The process continues until the customer and the development team understands the exact requirements of the proposed system. When the final prototype is developed, the requirements are considered to be frozen.
www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm 4/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

The prototyping approach is used in the requirements gathering and analysis phase to capture the exact requirements of the proposed system. After the requirements are frozen, the remaining phases of the development process need to be executed to complete the development of the software system. An e-commerce Web site, such as a shopping site, is an example where you can implement the prototyping approach. You can develop a prototype of the various Web pages of the shopping site, such as catalogue page, product order page, and credit card authentication page, and present it to the customer for approval. If the customer approves the prototype of the site, requirements are stated again and the design of the Web site is initiated. If the customer does not approve the Web site, the development team revisits the prototype and resubmits it to the customer for approval. This process continues until the prototype is approved. Prototypes are of two types: Throwaway prototypes : Prototypes that are eventually discarded rather than becoming a part of the finally delivered software. Examples of throwaway prototypes include screen mock-ups and storyboards. Evolutionary prototypes : Prototypes that evolve into the final system through iterative incorporation of user feedback. Although prototyping is a very useful technique to obtain accurate requirements of the system and to speed up the development process, it has some disadvantages associated with it. Some disadvantages of prototyping are: It gives clients the false impression that a few minor changes to the prototype will give them the required system. It may compromise on the overall quality of the software in the rush to develop the prototype. For example, the developer may use inefficient algorithms or inappropriate programming languages for developing the prototype quickly and the same may find place in the final application thus leading to inefficient code running in the final application.

Spiral Approach
The spiral approach includes the iterative nature of the prototyping approach and the linear nature of the waterfall approach. This approach is ideal for developing software that are released in various versions. In each iteration of the spiral approach, software development process follows the phase-wise linear approach. At the end of first iteration, the customer evaluates the software and provides the feedback. Based on the feedback, software development process enters into the next iteration and subsequently follows the linear approach to implement the feedback suggested by the customer. The process of iteration continues throughout the life of the software. An example of a spiral approach is the evolution of Windows operating system from Window 3.1 to Windows 2003.You may refer to Windows 3.1 operating system as the first iteration in the spiral approach. The product was released and evaluated by the customers, which include the market at large. After getting the feedback from customers about Windows 3.1, Microsoft planned to develop a new version of Windows operating system. Windows 95 was released with enhancements and graphical flexibility. Similarly, other versions of Windows operating system were released.
www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm 5/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

The spiral approach includes six phases: Customer communication: Includes understanding the system requirements by continuous communication between the customer and the system analyst. Planning: Includes estimating schedule, cost, and resource for the iteration. Risk analysis : Includes identifying, estimating, and monitoring technical and management risks, such as schedule slippage and cost overrun. Engineering: Includes requirement gathering and design of the software system. Construction and release : Includes coding, testing, and deploying software at the customer site and providing user-support documents. Customer evaluation: Includes evaluation of software by the customer and implementing feedback in the next iteration of the software development. The following figure shows the various phases in the spiral approach.

Win-Win Spiral Approach


The win-win spiral approach is an extension of the spiral approach. The phases in this approach are same as the phases in the spiral approach. The only difference is that at the time of identifying the requirements, the development team and the customer hold discussions and negotiate on the requirements that need to be
www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm 6/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

included in the current iteration of the software. The approach is called win-win because it is a winning situation for the development team and also for the customer. The customer wins by getting the product that fulfills most of the requirements while the development team wins by delivering software which is developed with all the requirements established after negotiations with the customer. The win-win spiral approach is generally used when you have timebound releases.

Incremental Approach
In an incremental approach, software requirements are broken down into various functional units. These functional units contain a group of similar tasks. A project activity list is created to prioritize the functional units with various activities to be performed in each functional unit. Each functional unit is implemented in an increment and the final product is achieved after all the functional units are implemented in the development process. Each increment includes three phases: design, implementation, and analysis. During the design phase of the first increment, the functionality with topmost priority from the project activity list is selected and the design is prepared. In the implementation phase, the design is implemented and tested. In the analysis phase, the functional capability of the partially developed product is analyzed. The development process is repeated until all the functions of the project are implemented. The following figure shows the incremental approach with various phases.

Consider an example where a bank wants to develop software to automate the banking process for insurance services, personal banking, and home and automobile loans. The bank wants the automation of personal banking system immediately because it will enhance the customer services. You can implement the incremental approach to develop the banking software. In the first increment, you can implement the personal banking feature and deliver it to the customer. In the later increments, you can implement the insurance services, home loans, and automobile loans features of the bank. The limitation of the incremental approach is that it is applicable only to large applications. This is because it is difficult to break small projects into smaller functional increments.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

7/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Just a minute:

Which of the following approaches includes the iterative nature of the prototyping approach and the linear nature of the waterfall approach? 1. Incremental approach 2. Spiral approach 3. Evolutionary approach Answer: 2. Spiral approach

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

8/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Understanding Object-Oriented Concepts


In the design phase of any software development approach, you can follow two approaches to software development. These are the function-oriented and object-oriented development approaches. The functionoriented approach is the erstwhile approach that evolved before the Object-Oriented (OO) approach. The function-oriented approach is module-centric and concentrates on functions of the software. This approach does not restrict the creation of modules that are tightly coupled and expose data to other parts of the program. Therefore, software constructed using the function-oriented approach may be so tightly coupled and interdependent that it may be difficult to separate the construction of one module from another. In addition, data may be visible and accessible throughout the program. Reusability of the software in this case becomes difficult. The limitations of the function-oriented approach gave way to the evolution of the object-oriented approach. The fundamental idea behind object orientation is to portray things as they exist in the real world. This helps to reduce the complexity of software systems. OO approach introduces the concept of inheritance which allows reuse of existing code components. In addition, OO approach supports encapsulation of data, abstraction, and polymorphism. The OO approach guides you to think in terms of reusability and therefore, helps in creating a better design.

Overview of OO Concepts
The various OO concepts are: Classes and objects : A class is an abstract data type that contains a set of attributes and functions. An object is an instance of a class. All the objects share the same copy of the member functions, but maintain a separate copy of the member data. To understand classes and objects, consider the analogy of a car. Cars such as BMW, Ferrari, and Chevrolet share certain similar features and, therefore, can be grouped to form the objects of the class, Cars. The following figure depicts a class and its objects.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

9/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Inheritance : Inheritance refers to sharing of attributes and behaviors among classes based upon hierarchical relationship. The inheritance feature allows you to define a new class by extending an existing class. The original class is called a base class or super class and the new class obtained through inheritance is called a derived class or a sub class. A base class is a generalization of the derived class, which means that the base class contains only those properties that are common to all the derived classes. Consider an example. Motorcycles, cars, and trucks have certain common properties - all have wheels, engines, and horns. Therefore, they can be grouped under a class called automobiles. Apart from sharing these common features, each subclass has its own particular characteristics, such as trucks run on diesel while cars may run on diesel or petrol. The following figure depicts inheritance of a derived class from the base class.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

10/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Inheritance of classes allows you to reuse code. If certain data or methods are similar in a set of classes, then instead of defining those methods and data in each class separately, you can define the common methods and data in the base class. The derived class can then simply inherit the common methods and attributes from the base class.
Abstraction: Abstraction focuses on essential, inherent aspects of an entity ignoring its implementation details. An abstract class specifies the abstract operation but does not include its implementation. The implementation is provided in the derived classes of the abstract class. Consider an example of the Polygon class that specifies an abstract operation, C o m p u t e A r e a ( ) . The Polygon class does not provide the implementation of the operation, C o m p u t e A r e a ( ) .The derived classes of the Polygon class, Rectangle and Square, implement the C o m p u t e A r e a ( )operation to compute the area of a rectangle and square. The following figure shows the P o l y g o nclass with its derived classes.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

11/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Encapsulation: Encapsulation means preventing access to non-essential details. For example, when you plug in the cord of the vacuum cleaner and switch it on, the vacuum cleaner starts smoothly. You cannot see the complex processes needed to actually convert electricity into suction power. In other words, the exact working of the vacuum cleaner has been encapsulated. Encapsulation is also called information hiding because it involves hiding attributes and operations of a class from other classes. Polymorphism: The concept of using operators or functions in different ways depending on what they are operating on is called polymorphism. Polymorphism in the context of operators refers to the difference in the functionality of an operator depending upon the type of the operands. When polymorphism is used in the context of functions performing different tasks, it is referred to as function overloading. An example of function overloading is an a d d ( ) function, which can take different signatures at run time. For instance, the function can be overloaded as a d d ( i n ta ,i n tb )or a d d ( f l o a ta ,f l o a tb )depending upon the type of parameters passed at run time. Consider the example of Countryside Markets Inc., which has no formal system to store its employee's information. The organization now wants to store detailed information about its employees, such as name, age, date of birth, e-mail id, department, employee code, salary drawn, and date of joining. The following figure shows six classes for the Countryside Markets Employee Information System.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

12/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

The preceding figure shows that classes are designed at three levels. The class at each subsequent level is derived from one or more classes of the previous level. For example, the E m p l o y e eclass is the parent class of the F u l lT i m eand Part Time classes, which inherit the properties of the Employee class. This is called single inheritance. In addition, the Developer class inherits the properties of both the F u l l T i m eand P a r tT i m eclasses. This is called multiple inheritance. The E m p l o y e eclass is an abstract class as it includes abstract functions, such as d i s p l a y ( i n t ) , a d d E m p l o y e e ( )and r e m o v e E m p l o y e e ( ) , which are implemented by the derived classes, F u l lT i m eand P a r tT i m e . The attributes of the E m p l o y e eclass are declared with protected access. This means that the attributes of this class are accessible to the Full Time and Part Time classes. Therefore, F u l lT i m eand P a r t T i m eclasses can modify the attributes of the E m p l o y e eclass. The attributes BasicSalary and OtherPerks of the F u l lT i m eclass have private access. Therefore, the derived classes, M a n a g e r , E n g i n e e r , and D e v e l o p e r cannot access these attributes directly. The attributes of the P a r t T i m eclass, fee and timeWorked, also cannot be accessed by the E n g i n e e ror M a n a g e rclass.
www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm 13/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

The d i s p l a y ( i n t )function is provided in all classes. The d i s p l a y ( i n t )function specified in the Employee class is an abstract operation. The implementation of the d i s p l a y ( i n t )function is provided in the Full Time and Part Time classes. The derived classes, Manager and Engineer, override the d i s p l a y ( i n t )function of the Full Time class to display information for the Manager and Engineer classes. This represents the polymorphism concept of object-oriented design.

Just a minute:

Which phase of SDLC includes translation of the requirements specified in the SRS into a logical structure that can be implemented in a programming language? 1. Feasibility analysis 2. Design 3. Coding 4. Maintenance Answer: 2. Design

Role of Object-Oriented Analysis and Design (OOAD) in SDLC


To understand OOAD, you need to understand where OO approach fits into software development life cycle. OO approach does not replace the standard approaches, such as Data Flow Diagrams (DFD) or Entity Relationship (ER) diagrams. OO approach is only an addition to the existing toolkit. OOAD uses the OO approach to solve the real world problems. It uses OO approach to analyze the system requirements and break a large and complex system into smaller and simpler components. OOAD is analysis of requirements and design of software system in terms of the objects, classes, encapsulation, inheritance, polymorphism, abstraction, and dynamic binding. In addition, OOAD is a methodology that can be applied to any software development approach. If you compare the definition of analysis involved in any of the software development approaches with the definition of OOAD, the only aspect that is new is analyzing the requirements in terms of objects and object classes.

An ER diagram is a modeling technique used to create a graphical representation of the entities and their relationship. A DFD is a graphical technique used to depict data flow throughout the system.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

14/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Summary
In this chapter, you learned that: SDLC is a disciplined and systematic approach towards software development. SDLC divides the software development process into six phases: Feasibility analysis Requirement analysis and specification Design Coding Testing Maintenance Different types of projects have different requirements. Therefore, it may be required to tailor the SDLC phases according to the specific needs of the project. This gives rise to various software development approaches. Some of these approaches are: Waterfall approach Prototyping approach Spiral approach Win-win spiral approach Incremental approach The function-oriented approach is module-centric and concentrates on the functions of the software. The Object-Oriented (OO) approach supports reusability and encapsulation of data and concepts such as inheritance, abstraction, and polymorphism. OOAD is analysis of requirements and design of software system in terms of objects, classes, encapsulation, inheritance, polymorphism, abstraction, and dynamic binding.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

15/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Exercises

Exercise 1
Technology Systems Inc. needs to develop software for a bank that will offer new service to its customers. The service enables the customers of the bank to pay telephone bills through the Internet. The bank is offering this service as an experiment, and as a result, the requirements of the software are not consistent. Being an experimental project, the requirements of the software could also evolve during the softwaredevelopment process. The new requirements of the software include sophisticated user interaction and easy-to-use interface. Another important requirement for the software is maintaining security and privacy of customer information because the software will involve authorizing and authenticating credit-card information provided by the customer. The bank is also planning to provide the same service on mobile phones. Other competitors of the bank are also planning to offer the same service and, therefore, the bank requires a working system for this software as soon as possible. Only a few top-level managers of the bank, who have identified this new service, can provide the full requirements on this software. However, these employees are not frequently available due to their workload and prior appointments. Identify the approach to be used for developing the software for the bank and justify your choice of approach.

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

16/17

7/21/12

Object-Oriented Analysis and Design Using UML: Student Guide

Reference Links

Understanding Software Development Life Cycle (SDLC)


Reference Reading: Books Software Engineering A Practitioner's Approach by Roger S Pressman Publisher: McGraw Hill Reference Reading: URLs http://www.mhhe.com/engcs/compsci/pressman

Understanding Object-Oriented Concepts


Reference Reading: Books Software Engineering A Practitioner's Approach by Roger S Pressman Publisher: McGraw Hill Reference Reading: URLs http://www-106.ibm.com/developerworks/ rational/library/998.html

www.niitstudent.com/india/Content/063OUML1S1/OEBPS/07_ch01.htm

17/17

Das könnte Ihnen auch gefallen