BC0057 - Object Oriented Analysis and Design

10
Course: Bachelor of Computer Application (BCA) – Semester 5 Subject: BC0057 – Object Oriented Analysis and Design Registration No. 511114661 Question 1- What are the potential advantages of treating two related classes as subclasses of some superclass? Answer: If you do that, many definitions and later changes have to be done but in a single place, where they will affect the two (or more) subclasses. One of the major advantages of treating two related classes as subclasses of some super class is that you can make some changes in a single place. In programming there are classes that may require auditing before submitting it to java or to another class. The potential advantage of treating two related classes as subclasses is that you can make changes in a single place. This is found in object orienting programming. In programming there are classes that may require auditing before submitting it to java or to another class. Question 2 - Explain the various tools for software implementation. Answer: Component-based development CASE Tools: Computer Aided Software Engineering (CASE) tools allow their users to rapidly develop information systems. The main goal of CASE technology is the automation of the entire information systems development life cycle process using a set of integrated software tools, such as modeling, methodology, and automatic code generation. However, most often, the code generated by CASE tools is only the skeleton of an application and a lot needs to be filled in by programming by hand. A new generation of CASE tools is beginning to support Component Based Development. Component Based Development: CBD is an industrialized approach to the software development process. Application development moves from custom 1

description

SMUDE BCA Sem 6 OOPS assignment - solved one

Transcript of BC0057 - Object Oriented Analysis and Design

Page 1: BC0057 - Object Oriented Analysis and Design

Course: Bachelor of Computer Application (BCA) – Semester 5

Subject: BC0057 – Object Oriented Analysis and Design Registration No. 511114661

Question 1- What are the potential advantages of treating two related classes as subclasses of some superclass?

Answer: If you do that, many definitions and later changes have to be done but in a

single place, where they will affect the two (or more) subclasses. One of the major

advantages of treating two related classes as subclasses of some super class is that

you can make some changes in a single place. In programming there are classes

that may require auditing before submitting it to java or to another class. The

potential advantage of treating two related classes as subclasses is that you can

make changes in a single place. This is found in object orienting programming. In

programming there are classes that may require auditing before submitting it to java

or to another class.

Question 2 - Explain the various tools for software implementation.

Answer: Component-based development

CASE Tools: Computer Aided Software Engineering (CASE) tools allow their users to

rapidly develop information systems. The main goal of CASE technology is the

automation of the entire information systems development life cycle process using a

set of integrated software tools, such as modeling, methodology, and automatic

code generation. However, most often, the code generated by CASE tools is only the

skeleton of an application and a lot needs to be filled in by programming by hand. A

new generation of CASE tools is beginning to support Component Based

Development.

Component Based Development: CBD is an industrialized approach to the

software development process. Application development moves from custom

development to assembly of prebuilt, pretested, reusable software components that

operate with each other. Two basic ideas underlie component-based development.

First, the application development can be improved significantly if applications can

be assembled quickly from prefabricated software components. Second, an

increasingly large collection of interpretable software components could be made

available to developers in both general and specialist catalogs.

Software Components: The software components are the functional units of a

program, building blocks offering a collection of reusable services. A software

1

Page 2: BC0057 - Object Oriented Analysis and Design

component can request a service from another component or deliver its own

services on request. The delivery of services is independent, which means that

components work together to accomplish a task. In short, the object-oriented

concept addresses analysis, design, and programming, whereas component-based

development is concerned with the implementation and system integration aspects

of software development.

Rapid Application Development: RAD is a set of tools and techniques that can be

used to build an application faster than typically possible with traditional methods.

The term often is used in conjunction with software prototyping. RAD does not

replace the system development life cycle but complements it, since it focuses more

on process description and can be combined perfectly with the object-oriented

approach. The task of RAD is to build the application quickly and incrementally

implement the design and user requirements, through tools such as Delphi, Visual

Age, Visual Basic, or Power Builder.

Incremental testing: If you wait until after development to test an application for

bugs and performance, you could be wasting thousands of dollars and hours of time.

Testing should be an integral part of SDLC.

Question 3 - What are patterns? Explain different types of patterns.

Answer: Pattern identifies the key aspects of a common design structure that make

it useful for creating a reusable object-oriented design. It identifies the participating

classes and instances, their roles and collaborations, and the distribution of

responsibilities. It describes when it applies, whether it can be applied in view of

other design constraints, and the consequences and trade-offs of its use.

A pattern is instructive information that captures the essential structure and insight

of a successful family of proven solutions to a recurring problem that arises within a

certain context and system of forces.

A pattern involves a general description of a solution to a recurring problem bundle

with various goals and constraints. But a pattern does more than just identify a

solution; it also explains why the solution is needed. However, not every solution,

algorithm, best practice, maxim, or heuristic constitutes a pattern (one or more key

pattern ingredients may be absent). Even if something appears to have all the

requisite pattern components, it should not be considered a pattern until it has been

verified to be a recurring phenomenon (preferably found in at least three existing

systems; this often is called the rule of three). A “pattern in waiting”, which is not yet

known to recur, sometimes is called a proto-pattern.

Coplien explains that a good pattern will do the following:

2

Page 3: BC0057 - Object Oriented Analysis and Design

It solves a problem. Patterns capture solutions, not just abstract principles or

strategies.

It is a proven concept. Patterns capture solutions with a track record, not

theories or speculation.

The solution is not obvious. The best patterns generate a solution to a problem

indirectly – a necessary approach for the most difficult problems of design.

It describes a relationship. Patterns do not just describe modules, but describe

deeper system structures and mechanisms.

The pattern has a significant human component. All software serves human

comfort or quality of life; the best patterns explicitly appeal to aesthetics and

utility.

Generative and Non-generative Patterns

Generative patterns are patterns that not only describe a recurring problem; they

can tell us how to generate something and can be observed in the resulting system

architectures they helped shape. Generative patterns are dynamic.

Non-generative patterns are static and passive: They describe recurring phenomena

without necessarily saying how to reproduce them.

The successive application of several patterns, each encapsulating its own problem

and forces, unfolds a larger solution, which emerges indirectly as a result of the

smaller solutions. It is the generation of such emergent behavior that appears to be

what is meant by generativity.

Anti-patterns

A pattern represents a “best practice”, whereas an anti-pattern represents “worst

practice” or a “lesson learned”. Anti-patterns come in two varieties:

Those describing a bad solution to a problem that resulted in a bad situation.

Those describing how to get out of a bad situation and how to proceed from there

to a good solution.

Coplien explains that:

The study of anti-patterns is an important research activity. The presence of “good”

patterns in a successful system is not enough; you also must show that those

patterns are absent in unsuccessful systems. Likewise, it is useful to show the

presence of certain patterns (anti-patterns) in unsuccessful systems, and their

absence in successful systems.

Capturing Patterns

The process of looking for patterns to document is called pattern mining (or

sometimes reverses architecting). An interesting initiative started within the

software community is to share experience with patterns and develop an ever-

3

Page 4: BC0057 - Object Oriented Analysis and Design

growing repository of patterns. It is important to remember that a solution in which

no forces are present is not a pattern.

Focus on practicability. Patterns should describe proven solutions to recurring

problems rather than the latest scientific results.

Aggressive disregard of originality. Pattern writers do not need to be the

original inventor or discoverer of the solutions that they document.

Non-anonymous review. Pattern submissions are shepherded rather than

reviewed. The shepherd contacts the pattern author(s) and discusses with him or

her how the patterns might be clarified or improved on.

Writers’ workshops instead of presentations. Rather than being presented

by the individual authors, the patterns are discussed in writers’ workshops, open

forums where all attending seek to improve the patterns presented by discussing

what they like about them and the areas in which they are lacking.

Careful editing. The pattern authors should have the opportunity to incorporate

all the comments and insights during the shepherding and writers’ workshops

before presenting the patterns in their finished form.

Question 4 - Explain the Booch Methodology.

Answer: The Booch methodology is a widely used object-oriented method that

helps you design your system using the object paradigm. The Booch method

consists of the following diagrams:

Class diagrams

Object diagrams

State transition diagrams

Module diagrams

Process diagrams

Interaction diagrams

The Booch methodology prescribes a macro development process and a micro development process.

Fig. 4.4: Object modeling using Booch notation. The arrows represent specialization; for example, class Taurus is subclass of the class Ford.

Operator::TurnOffAlarm

Enabled

4

Page 5: BC0057 - Object Oriented Analysis and Design

SoundAlarm Silenced Sounding

SilenceAlarm

Enable Disable

DisabledAlarmFixed

The Macro development process

The macro process serves as a controlling framework for the micro process and can

take weeks or even months. The macro development process consists of the

following steps:

1. Conceptualization. During conceptualization, you establish the core

requirements of the system. You establish a set of goals and develop a prototype to

prove the concept.

2. Analysis and development of the model. In this step, you use the class

diagrams to describe the roles and responsibilities objects are to carry out in

performing the desired behavior of the system. Then, you use the object diagram to

describe the desired behavior of the system in terms of scenarios or alternatively,

use the interaction diagram to describe behavior of the system in terms of scenarios.

3. Design or create the system architecture. In the design phase, you use the

class diagram to decide what classes exist and how they relate to each other. Next,

you use the object diagram to decide what

mechanisms are used to regulate how objects collaborate. Then, you use the module

diagram to map out where each class and object should be declared. Finally, you use

the process diagram to determine to which processor to allocate a process. Also,

determine the schedules for multiple processes on each relevant processor.

4. Evolution or implementation. Successively refine the system through much

iteration. Produce a stream of software implementations (or executable releases),

each of which is a refinement of the prior one.

5

Page 6: BC0057 - Object Oriented Analysis and Design

5. Maintenance. Make localized changes to the system to add new requirements

and eliminate bugs.

The Micro development process

Each macro development process has its own micro development processes. The

micro development process consists of the following steps:

1. Identify classes and objects.

2. Identify class and object semantics.

3. Identify class and object relationships.

4. Identify class and object interfaces and implementation.

Question 5 - Why does every interaction diagram need a written description? Explain.

Answer:

Question 6 - Explain the five core workflows of the Unified Process.

Answer: The Workflows of the Unified Process

The figure 12.1 shows five workflows, namely, the requirements workflow, analysis

workflow, design workflow, implementation workflow, and test workflow. In each

increment (there are four increments in Fig.12.1), part of each of these five

workflows is carried out. The emphasis is on the requirements and analysis

workflows in the earlier increments, whereas the implementation workflow is the

major focus in the later increments. The test workflow is important throughout the

life cycle. However, there is an increased emphasis on testing toward the end of the

life cycle. In addition to these five core workflows, the Unified Process includes other

workflows, such as management and planning that are carried out in parallel with

the core workflows.

The Requirements Workflow

The aim of the requirements workflow is to ensure that the developers build the right

information system. This is achieved by describing the target information system

sufficiently clearly and accurately that the two main stakeholders, the client and the

developers, can agree on what the information system should do and should not do.

In order to achieve this, the requirements have to be fully understood by the client.

One way to achieve this is to use the Unified Process; the many models of the

Unified Process assist the client in gaining the necessary detailed understanding of

what is to be developed.

The Analysis Workflow

6

Page 7: BC0057 - Object Oriented Analysis and Design

The purpose of the analysis workflow is to analyze and refine the requirements. By

doing this we achieve the detailed understanding of the requirements that we must

have to develop an information system correctly and to maintain it easily. But why

do we have an analysis workflow at all? Surely it would be simpler to develop an

information system by continuing with further iterations of the requirements

workflow until we obtain the necessary understanding of the target information

system.

The key point is that the output of the requirements workflow must be totally

comprehensible by the client. In other words, the artifacts of the requirements

workflow must be expressed in the language of the client, that is, in a natural

(human) language such as English, Armenian, or Zulu. But all natural languages,

without exception, are somewhat imprecise and lend themselves to

misunderstanding.

For example, consider the following paragraph:

A part record and a plant record are read from the database. If it contains the letter

A directly followed by the letter Q, then calculate the cost of transporting that part to

that plant.

The solution is to have two separate workflows. The requirements workflow is

couched in the language of the client, the analysis workflow is a more precise

language that will ensure that the design and implementation workflows are

correctly carried out. In addition, more details are added during the analysis

workflow, details that are not relevant to the client’s understanding of the target

information system but are essential for the information technology professionals

who will develop the information system.

The Design Workflow

During the design workflow we refine the analysis workflow until the material is in a

form that can be implemented by the programmers. In addition, a number of

requirements need to be finalized at this time, including choice of programming

language, as well as reuse and portability issues.

The Implementation Workflow

The aim of the implementation workflow is to implement the target information

system in the selected implementation language. More precisely, a large information

system is partitioned into smaller subsystems, which are then implemented in

parallel by coding teams. The subsystems, in turn, consist of components or code

artifacts. As soon as a component has been coded, the programmer tests it. Once

the programmer is satisfied that the component is correct, it is passed onto the

quality assurance group for further testing.

The Test Workflow

7

Page 8: BC0057 - Object Oriented Analysis and Design

The test workflow is the responsibility of the quality assurance group. As pointed out

at the end of the previous section, each component is tested by the quality

assurance group as soon as it has been implemented; this is termed unit testing. At

the end of each iteration, integration testing is performed. Here, the components

that have been completed and unit tested are compiled and linked together

(integrated) and then tested against various test cases. When the product appears

to be complete, it is tested as a whole; this is termed product testing.

When management believes that the product is fault-free, it is installed on the

client’s computer. The client now performs acceptance testing. That is, the client

checks whether the delivered information system satisfies its specifications. If the

information system passes the acceptance test, the client pays the developers. If

not, the developers have to fix the information system until it passes the acceptance

test.

8