53
1 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN L T P C 3 0 0 3 OBJECTIVES: 1. To learn basic OO analysis and design skills through an elaborate case study 2. To use the UML design diagrams 3. To apply the appropriate design patterns UNIT I 9 Introduction to OOAD – What is OOAD? – What is UML? What are the United process(UP) phases - Case study – the NextGen POS system, Inception -Use case Modeling - Relating Use cases – include, extend and generalization. UNIT II 9 Elaboration - Domain Models - Finding conceptual classes and description classes – Associations – Attributes – Domain model refinement – Finding conceptual class hierarchies- Aggregation and Composition- UML activity diagrams and modeling UNIT III 9 L.Sagaya Desdemona/IT

2marks Ooad Notes Revised1

Embed Size (px)

Citation preview

Page 1: 2marks Ooad Notes Revised1

1 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN L T P C 3 0 0 3

OBJECTIVES:

1. To learn basic OO analysis and design skills through an elaborate case study

2. To use the UML design diagrams

3. To apply the appropriate design patterns

UNIT I 9

Introduction to OOAD – What is OOAD? – What is UML? What are the United

process(UP) phases - Case study – the NextGen POS system, Inception -Use case

Modeling - Relating Use cases – include, extend and generalization.

UNIT II 9

Elaboration - Domain Models - Finding conceptual classes and description classes –

Associations – Attributes – Domain model refinement – Finding conceptual class

hierarchies- Aggregation and Composition- UML activity diagrams and modeling

UNIT III 9

System sequence diagrams - Relationship between sequence diagrams and use cases

Logical architecture and UML package diagram – Logical architecture refinement - UML

class diagrams - UML interaction diagrams

UNIT IV 9

GRASP: Designing objects with responsibilities – Creator – Information expert – Low

Coupling –Controller – High Cohesion – Designing for visibility - Applying GoF design

patterns – adapter, singleton, factory and observer patterns.

UNIT V 9

UML state diagrams and modeling - Operation contracts- Mapping design to code -UML

deployment and component diagrams

TOTAL: 45 PERIODS

TEXT BOOK :

1.Craig Larman,"Applying UML and Patterns: An Introduction to object-oriented

Analysis and Design and iterative development”, Third Edition, Pearson Education,

2005

L.Sagaya Desdemona/IT

Page 2: 2marks Ooad Notes Revised1

2 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

REFERENCES:

1. Mike O’Docherty, “Object-Oriented Analysis & Design: Understanding System

Development with UML 2.0”, John Wiley & Sons, 2005.

2. James W- Cooper, Addison-Wesley, “Java Design Patterns – A Tutorial”, 2000.

3. Micheal Blaha, James Rambaugh, “Object-Oriented Modeling and Design with UML”,

Second Edition, Prentice Hall of India Private Limited, 2007

4. Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides,“Design patterns:

Elements of Reusable object-oriented software”, Addison-Wesley, 1995.

UNIT-I

1. What is Analysis and Design? Analysis emphasizes an investigation of the problem and requirements, rather than a solution. For example, if a new online trading system is desired, Analysis answers the following questions : How will it be used? What are its functions? Design emphasizes a conceptual solution (in software and hardware) that fulfills the requirements, rather than its implementation. Useful analysis and design have been summarized in the phrase do the right thing (analysis), and do the thing right (design).

2. Give the OOAD process?

3. What is Object Oriented Analysis and Design?During object-oriented analysis there is an emphasis on finding and describing the objects

or concepts in the problem domain. For example, in the case of the flight information system, some of the concepts include Plane, Flight, and Pilot. During object-oriented design (or simply, object design) there is an emphasis on defining software objects and how they collaborate to fulfill the requirements. For example, a Plane software object may have a tailNumber attribute and a getFlightHistory method

4. Define a Domain Model. Object-oriented analysis is concerned with creating a description of the domain from the perspective of objects. There is an identification of the concepts, attributes, and associations that are considered noteworthy. It can be noted that a domain model is not a description of

L.Sagaya Desdemona/IT

Page 3: 2marks Ooad Notes Revised1

3 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

software objects; it is a visualization of the concepts or mental models of a real-world domain and it is also called a conceptual object model.

5. Give and example of domain model?

6. Give an example of class diagram?

7. What is the critcal ability of an Object Oriented System? A critical ability of Object Oriented development is to skillfully assign responsibilities to software objects. It is one activity that must be performed either while drawing a UML diagram or programming and it strongly influences the robustness, maintainability, and reusability of software components.

8. What is iterative development. In this life cycle

approach, development is organized into a series of short, fixed-length (for example, three-week) mini-projects called iterations; the outcome of each is a tested, integrated, and executable partial system.

9. Write about the traditional development methodologies?

Most traditional development methodologies are either algorithm centric or data centric.a. Algorithm-centric methodologyYou think of an algorithm that can accomplish the task, and then build data structures forthat algorithm to use.b. Data- centric methodology

L.Sagaya Desdemona/IT

Page 4: 2marks Ooad Notes Revised1

4 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

You think how to structure the data, and then build the algorithm around that structure.

10. Define objects.Object is a real- world entity, identifiably separate from its surroundings, has a well

defined set of attributes and a well-defined set of procedures or methods. Properties (orattributes) describe the state (data) of an object. Methods (procedures) define its behavior.Object means a combination of data and logic that represents some real-world entity.(E.g.) Car is an objectColor, manufacturer, cost, owner etc are attributes.Drive it, lock it, tow it, carry passengers in it are all methods

11. Write the characteristics of an object.Identity, classification, polymorphism, and inheritance.

12.What is a class?A class is a set of objects that share a common structure and a common behavior.

13. Name two types of object diagram.Class diagram and instance diagram.

14. What is an attribute? Give example.An attribute is a data value held by the objects in a class .Example: name, age and weight

are attributes of Person class.

15. Give a brief note on object behaviorObject behavior is described in methods or procedures. Behavior denotes the collection

of methods that abstractly describes what an object is capable of doing. Each procedure definesand describes a particular behavior of an object. Methods encapsulate the behavior of the object.Objects take responsibility for their own behavior.

16. What is the UML? The Unified Modeling Language(UML) is a visual language for specifying, constructing and documenting the artifacts of systems. The word visual in the definition is a key point - the UML is the de facto standard diagramming notation for drawing or presenting pictures (with some text) related to software primarily OO software

17. What are the three perspectives to apply UML? Three Perspectives to Apply UML1. Conceptual perspective the diagrams are interpreted as describing things in a situation of the real world or domain of interest.2. Specification (software) perspective the diagrams (using the same notation as in the conceptual perspective) describe software abstractions or components with specifications and interfaces, but no commitment to a particular implementation (for example, not specifically a class in C# or Java).3. Implementation (software) perspective the diagrams describe software

L.Sagaya Desdemona/IT

Page 5: 2marks Ooad Notes Revised1

5 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

implementations in a particular technology (such as Java).

18. Define a) Conceptual Class,b) Software Class,c) Implementation Class.Conceptual class - real-world concept or thing. A conceptual or essential perspective. The UP Domain Model contains conceptual classes.Software class - a class representing a specification or implementation perspective of a software component, regardless of the process or method.Implementation class - a class implemented in a specific OO language such as Java.

19. What is the Unified Process(UP)? A software development process describes an approach to building, deploying, and

possibly maintaining software. The Unified Process has emerged as a popular iterative software development process for

building object-oriented systems.

20. What is the importance of the Unified Process(UP)?The UP is an iterative process. Iterative development influences how to

introduce OOA/D , and to understand how it is best practiced.2) UP practices provide an example structure for how to do and thus how to explain OOA/D. 1) The UP is flexible, and can be applied in a lightweight and agile approach that includes practices from other agile methods (such as XP or Scrum).

21. What are the benefits of iterative development?Benefits include:

less project failure, better productivity, and lower defect rates; shown by research into iterative and evolutionary methods

early rather than late mitigation of high risks (technical, requirements, objectives, usability, and so forth) early visible progress

early feedback, user engagement, and adaptation, leading to a refined system that more closely meets the real needs of the stakeholders

managed complexity; the team is not overwhelmed by "analysis paralysis" or very long and complex steps

the learning within an iteration can be methodically used to improve the development process itself, iteration by iteration

22. What is the need for feedback and adaptation?The Need for Feedback and AdaptationIn complex, changing systems (such as most software projects) feedback and adaptation are key ingredients for success.

Feedback from early development, programmers trying to read specifications, and client demos to refine the requirements.

Feedback from tests and developers to refine the design or models. Feedback from the progress of the team tackling early features to refine the

schedule and estimates.

L.Sagaya Desdemona/IT

Page 6: 2marks Ooad Notes Revised1

6 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

Feedback from the client and marketplace to re-prioritize the features to tackle in the next iteration

23. What are agile methods? Agile development methods usually apply time boxed iterative and evolutionary development, employ adaptive planning, promote incremental delivery, and include other values and practices that encourage agility, rapid and flexible response to change. Agile methods share best practices like evolutionary refinement of plans, requirements, and design. In addition, they promote practices and principles that reflect an agile sensibility of simplicity, lightness, communication, self-organizing teams, and more.

24. Name any five agile principles.a) Satisfy the customer through early and continuous delivery of valuable

software.b) Agile processes harness change for customer’s competitive advantage.c) Deliver working software frequentlyd) Agile software promote sustainable developmente) The best,architecture,requirements,and designs emerge from self-

organizing teams

25. What are the other Critical UP practices? The idea for UP practice is short time boxed iterative, evolutionary, and adaptive development. Some additional best practices and key ideas in UP are

Tackle high-risk and high-value issue in early iterations Continual evaluation,feedback and requirements from users Build cohesive,core architecture in ealy iterations Continuously verify quality;test early,often and realistically Practice Change Request and Configuration Management

26. What are the different UP Phases?An UP Project organizes work and iterations across four major phases :1) Inception – approximate Vision,Business case,Scope,vague estimates2) Elaboration – Refined BVision,iterative implementation of the core

architecture,resolution of high risks,identification of most requirements and scope,more realistic estimates

3) Construction – Iterative implementation of the remaining lower risk and easier elements,and preparation for deployment

4) Transition – beta tests, deployment

27. What are the UP disciplines?In the UP,an artifact is the general term for any work product : Code,Web Graphics,Schema,Test Documents,diagrams,model and so on. Some of the artifacts in the following Disciplines are :

a) Business Modeling – The Domain Model artifact,to visualize noteworthy concepts in the application domain

L.Sagaya Desdemona/IT

Page 7: 2marks Ooad Notes Revised1

7 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

b) Requirements – The Use Case Model and Supplementary specification artifacts to capture functional and non-functional requirements

c) Design – The Design Model artifact,to design the software artifactsd) Implementation – Programming and building the system,not deploying it

28. What is Inception? Envision the product scope,vision,and business case.Do the stakeholders have basic agreement on the vision of the project,and is it worth investing

in serious investigations? The purpose of inception stage is not to define all the requirements. The Up is not the

waterfall and the first phase inception is not the time todo all requirements or create believable estimates or plans. That happens during elaboration.

29. How long is the Inception phase can be?The intent of inception is to establish some initial common vision for the objectives of the project, determine if it is feasible, and decide if its is worth some serious investigation in elaboration. It can be brief.

30. Define Requirements. Requirements are capabilities and conditions to which the system – and more broadly, the project must conform.The UP promotes a set of best practices, one of which is to manage requirements.In the context of changing and unclear stakeholder’s wishes – Managing requirements means – a systematic approach to finding,documenting,organizing,and tracking the changing requirements of a system. A prime challenge of requirements analysis is to find,communicate,and remember(Towrite down) what is really needed, in a formthat clearly speaks to the client and development team members.

31. What are the types and categories of requirements? In the UP, requirements are categorized according to the FURPS+ model [Grady92], a useful mnemonic with the following meaning :

Functional - features, capabilities, security. Usability - human factors, help, documentation. Reliability - frequency of failure, recoverability, predictability. Performance - response times, throughput, accuracy, availability, resource usage. Supportability - adaptability, maintainability, internationalization, configurability.

The "+" in FURPS+ indicates ancillary and sub-factors, such as: Implementation resource limitations, languages and tools, hardware, ... Interface constraints imposed by interfacing with external systems. Operations system management in its operational setting. Packaging for example, a physical box. Legal licensing and so forth.

32. What are the key requirement artifacts? The Key requirements artifacts are :

L.Sagaya Desdemona/IT

Page 8: 2marks Ooad Notes Revised1

8 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

Use-Case Model Supplementary SpecificationGlossary VisionBusiness Rules

33. What are Use Cases? Informally, use cases are text stories of some actor using a system to meet goals.

34. Define a) Actors,b)Scenarios,and c) Use cases. Informal definitions:

An actor is something with behavior, such as a person (identified by role), computer system, or organization; for example, a cashier.A scenario is a specific sequence of actions and interactions between actors and the system; it is also called a use case instance. Informally then, a use case is a collection of related success and failure scenarios that describe an actor using a system to support a goal

35. What are the three kinds of Actors? Actors are roles played not only by people, but by organizations, software, and machines. There are three kinds of external actors in relation to the SuD:

Primary actor has user goals fulfilled through using services of the SuD. For example, the cashier.

Why identify? To find user goals, which drive the use cases.Supporting actor provides a service (for example, information) to the SuD. The

automated payment authorization service is an example. Often a computer system, but could be an organization or person.

Why identify? To clarify external interfaces and protocols.Offstage actor has an interest in the behavior of the use case, but is not primary or

supporting; for example, a government tax agency. Why identify? To ensure that all necessary interests are identified and satisfied.

36. What are preconditions and postconditions?Preconditions state what must always be true before a scenario is begun in the use case. Preconditions are not tested within the use case; rather, they are conditions that are assumed to be true. Typically, a precondition implies a scenario of another use case, such as logging in, that has successfully completed. Success guarantees (or postconditions) state what must be true on successful completion of the use case either the main success scenario or some alternate path. The guarantee should meet the needs of all stakeholders.

37. How to find Use cases?Use cases are defined to satisfy the goals of the primary actors. Hence, the basic procedure is:

L.Sagaya Desdemona/IT

Page 9: 2marks Ooad Notes Revised1

9 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

1) Choose the system boundary. Is it just a software application, the hardware and application as a unit, that plus a person using it, or an entire organization?

2) Identify the primary actorsthose that have goals fulfilled through using services of the system.

3) Identify the goals for each primary actor.4) Define use cases that satisfy user goals; name them according to their goal.

Usually, user-goal level use cases will be one-to-one with user goals, but there is at least one exception, as will be examined.

38. Define use case relationships a)Include b)ExtendInclude RelationshipUse cases can be related to each other.It is common to have some partial behavior that is common across several use cases. Rather than duplicate this text, it is desirable to separate it into its own subfunction use case, and indicate its inclusion. This is simply refactoring and linking text to avoid duplication.

Extend Relationship Extend puts additional behavior in a use case that does not know about it. It is shown as a dotted line with an arrow point and labeled <<extend>> In this case, a customer can request a catalog when placing an order

UNIT-II

1. Explain object relationship and associations.a. Association represents the relationships between objects and classes.b. Associations are bidirectional.

c. Cardinality specifies how many instances of one class may relate to a single instance of an associated class.

d. Cardinality constraints the number of related objects and often is described as being “one” or “many”

2. What do you mean by consumer-producer association?

It is also known as client-server association. It uses relationship. It is a onewayinteraction in which one object requests the service of another object. The object that makes the

L.Sagaya Desdemona/IT

Page 10: 2marks Ooad Notes Revised1

10 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

request is the consumer or client and the object receives the request and provides the service isthe producer or server.

3. Write about static and dynamic binding?o Static bindingThe process of determining which functions to invoke at compile time is termed as staticbinding. Static binding optimizes the calls.o Dynamic bindingThe process of determining which functions to invoke at runtime are called as dynamic binding. They occur when polymorphic calls are issued. Dynamic binding allows some method invocation decisions to be deferred until the information is known.

4.Define object persistenceA file or a database can provide support for objects having a longer lifeline, longer than

the duration of the process for which they were created. This is called object persistence. Anobject can persist beyond application session boundaries, during which the object is stored in afile or a database. The object can be retrieved in an other application session and will have samestate and relationship.

5. Define meta-classes.If a class is an object, it must belong to a class which is called as meta-class or a class of

classes. All the objects are instances of a class and all classes are instances of a meta-class.Meta-classes are used by the compiler.

6. What do you mean by software development process?The software development process consists of

AnalysisDesignImplementationTestingRefinementThe essence of software development process is to transform users’ needs into a softwaresolution that satisfies those needs. The main point is to build highquality software.

7.Define collaboration.The object-oriented programming community has adopted use-cases to a remarkable

degree. Scenarios are a great way of examining who does what in the interactions among objectsand what role they play; that is their interrelationships. This intersection among objects’ roles toachieve a given goal is called collaboration.

8. Write the 80-20 rule.a. Documentation is another important activity, which does not end with object-oriented analysisbut should be carried out throughout the system development.b. The 80-20 rule generally applies for documentation:

L.Sagaya Desdemona/IT

Page 11: 2marks Ooad Notes Revised1

11 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

80 percent of the work can be done with 20 percent of the documentation.

9. Define Prototype. Give the types of prototype.A prototype is a version of a software product developed in the early stages of the

product’s life cycle for specific, experimental purposes. A prototype enables you to fullyunderstand how easy or difficult it will be to implement some of the features of the system. Italso gives users a chance to comment on the usability and usefulness of the user interface design.Prototypes have been categorized in various ways.• Horizontal prototype• Vertical prototype• Analysis prototype• Domain prototype

10. Write a brief note on RAD.a. Rapid application development (RAD) is a set of tools and techniques that can be used tobuild an application faster than typically possible with traditional methods.

11. What is Elaboration?1. Elaboration often consists of two or more iterations(2 to 6 weeks duration)2. Each iteration is time-boxed(i.e. End Date fixed)3. Elaboration is not Design Phase(i.e. the model is not fully developed)4. Also it is not throw away Prototype;rather the code and design are production quality

In other words,Elaboration is the initial series of iterations during which5. The core ,risky software architecture is programmed and tested6. The majority of requirements are discovered and stabilized7. The major risks are mitigated or reduced

12. Define Elaboration. Build the core architecture,resolve the high risk elements,Define most Requirements,and Estimate the overall schedule and resources

13. Define the first iteration is elaboration phase. Iteration-1 of Elaboration Phase emphasizes fundamental and common OOA/D skills used in building OO Systems.Example – NextGen POSIteration 1 RequirementsThe requirements for the first iteration of the NextGen POS application follow:Implement a basic, key scenario of the Process Sale use case: entering items and receiving a cash payment. Implement a Start Up use case as necessary to support the initialization needs of the iteration.Nothing fancy or complex is handled, just a simple happy path scenario, and the design and implementation to support it. There is no collaboration with external services, such as a tax calculator or product database. No complex pricing rules are applied.

L.Sagaya Desdemona/IT

Page 12: 2marks Ooad Notes Revised1

12 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

The design and implementation of the supporting UI ,database,are done Subsequent iterations will grow on this foundation.

14. What happens in inception?Inception is a short step to elaboration. It determines basic feasibility,risk and scope,to decide if the project is worth more serious investigation

15. What are the likely activities and artifacts in inception?A short requirement workshopMost actors,goals and Use Cases named.Most use cases written in brief format; 1—20% of use cases written in fully dressed formatMost influential and risky quality requirements identifiedSupplementary specification written(Version One)Risk ListTechnical proof-of-Concept,User Interface-Oriented PrototypesDecision on components : to buy/build/reuse taken(Eg. To buy Tax calculation packageHigh Level candidate Architecture made(not a detailed,final or correct one made)Used as starting point of investigation(Eg. A Java Client side application with no Application Server, and no Oracle for Database

16. What is a Domain Model? A domain Model is the most important and classic model in OO Analysis.It illustrates noteworthy Concepts in a Domain.Source of Inspiration for designing some software objects(which become inputs to several artifacts)

17. What are the criteria in planning the next iteration during elaboration phase?

Risk Technical complexity and factors such as uncertainity of effort or usability

Coverage Major parts of the system are at least touched on early iterationsCriticality Functions that client consider of high business value

18. Why call a domain model a visual dictionary? A domain model is a visual dictionary of the noteworthy abstractions domain vocabulary,and information content .A domain model visualizes and relates words or concepts in the domain. It also shows an abstraction of the conceptual classes and shows how they relate to each other.

19. What are conceptual classes? Conceptual Classes

Informally, a conceptual class is an idea, thing, or object. More formally, a conceptual class may be considered in terms of its symbol, intension, and extension

• Symbol—words or images representing a conceptual class.

L.Sagaya Desdemona/IT

Page 13: 2marks Ooad Notes Revised1

13 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

• Intension—the definition of a conceptual class.• Extension—the set of examples to which the conceptual class applies.

20 . Are domain and Data Models are the same thing? A domain model is not a data model (which by definition shows persistent data to be stored somewhere)

21. How a domain model is created? Steps involved in creating a domain model :Find the conceptual classesDraw them as classes in a UML class diagramAdd associations and attributes

22. What are the three strategies to find conceptual classes?Reuse or modify existing models(First,Best,and easiest approach). There are

published ,well crafted domain models and data models for many common domains ,such as inventory,finance,health,banking,and so forth.

Use a Category ListIdentify noun phrases.

23. What is a Domain Model? A domain Model is the most important and classic model in OO Analysis.It illustrates noteworthy Concepts in a Domain.Source of Inspiration for designing some software objects(which become inputs to several artifacts)

24. What are the criteria in planning the next iteration during elaboration phase?

Risk Technical complexity and factors such as uncertainity of effort or usability

Coverage Major parts of the system are at least touched on early iterationsCriticality Functions that client consider of high business value

25. Why call a domain model a visual dictionary? A domain model is a visual dictionary of the noteworthy abstractions domain vocabulary,and information content .A domain model visualizes and relates words or concepts in the domain. It also shows an abstraction of the conceptual classes and shows how they relate to each other.

26. What are conceptual classes? Conceptual Classes

Informally, a conceptual class is an idea, thing, or object. More formally, a conceptual class may be considered in terms of its symbol, intension, and extension

• Symbol—words or images representing a conceptual class.• Intension—the definition of a conceptual class.

L.Sagaya Desdemona/IT

Page 14: 2marks Ooad Notes Revised1

14 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

• Extension—the set of examples to which the conceptual class applies.

27 . Are domain and Data Models are the same thing? A domain model is not a data model (which by definition shows persistent data to be stored somewhere)

28. How a domain model is created? Steps involved in creating a domain model :Find the conceptual classesDraw them as classes in a UML class diagramAdd associations and attributes

29. What are the three strategies to find conceptual classes?Reuse or modify existing models(First,Best,and easiest approach). There are

published ,well crafted domain models and data models for many common domains ,such as inventory,finance,health,banking,and so forth.

Use a Category ListIdentify noun phrases.

30. What are Description classes? Give examples.A Description class contains information that descrkibes something else. For example,a

ProductDescription that records the price,picture,and text descriptions of an item.This was first named the Item-Descriptor pattern.The need for description classesAn item instance represents a physical item in a store;it may have a serial numberAn item has description,price,and itemIDA Product Description class records information about itemsEven if all inventoried items are sold and corresponding item software instances are deleted,the Product Description still remains.

31. What is Association? Explain with an example. An association is a relationship between classes(more precisely,instances of these classes) that indicates some meaningful and interesting connections.

32. Explain Association using UML notation.UML Definition:Associations are defined as semantic relationship between two or more classifiers that involve connections among their instances

Records-current

L.Sagaya Desdemona/IT

Register Sale

Page 15: 2marks Ooad Notes Revised1

15 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

33. What are Description classes? Give examples.A Description class contains information that descrkibes something else. For example,a

ProductDescription that records the price,picture,and text descriptions of an item.This was first named the Item-Descriptor pattern.The need for description classesAn item instance represents a physical item in a store;it may have a serial numberAn item has description,price,and itemIDA Product Description class records information about itemsEven if all inventoried items are sold and corresponding item software instances are deleted,the Product Description still remains.

34. What is Association? Explain with an example. An association is a relationship between classes(more precisely,instances of these classes) that indicates some meaningful and interesting connections.

35. Explain Association using UML notation.UML Definition:Associations are defined as semantic relationship between two or more classifiers that involve connections among their instances

Records-current

36. What is multiplicity?Multiplicity defines how many instances of class A can be associated with one instance of a class B.

Stocks

1 + Fig. Multiplicity of an Association

37. What is 100% Rule? Or What is the rule of Conformance to Superclass Definition?

100% of the conceptual Superclass’s definition should be applicable to the subclass. The subclass must conform to 100% of the Superclass’s:2) attributes3) associations

38. What are the strong motivation to partition a conceptual class with subclasses?The following are the strong motivations to partition a class into subclasses :

L.Sagaya Desdemona/IT

Register Sale

StoreItem

Page 16: 2marks Ooad Notes Revised1

16 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

Create a conceptual subclass of a superclass when :1. The subclass has additional attributes of interest.2. The subclass has additional associations of interest3. The subclass concept is operated on,handled,reacted-to,or manipulated

differently than the superclass or other subclasses

39. Define a) Aggregation b) Composition. Aggregation is a vague kind of association in the UML that loosely suggests whole-part relationships

Compositions is also known as composite aggregation,is a strong kind of whole-part aggregation and is useful to show in some models. A composition relationship implies that 1) an instance of the part(such as a Square) belongs to only one composite instance(such as a Board) at a time, 2) the part must always belong to a composite,and 3) the composite is responsible for the creation and deletion of its parts – either by itself creating/deleting the parts,or by collaborating with other objects. Related to this constraint is that if the composite is destroyed,its parts must either be destroyed,or attached to another composite – no free floating Fingers allowed.

40. What are Association Role Names? Each end of an association is a role,which has various properties,such as :NameMultiplicity A role name identifies an end of an association and ideally describes the role played by objects in the association

UNIT-III

1. Give the two-three rule?

The two-three rule is for identifying actors. The rule is stated as “start with naming atleast two, preferable three, people who could serve as the actors in the system. Other actorscan be identified in the subsequent iterations.

2. List the approaches for identifying classes?The four alternative approaches for identifying classes:

The noun phrase approach.The common class patterns approach.The use-case driven, sequence/collaboration modeling approach.The classes, responsibilities and collaborators (CRC) approach.

3. What do you mean by relevant, fuzzy and irrelevant classes?In the noun phrase approach the list of nouns is divided into three categories:

L.Sagaya Desdemona/IT

Page 17: 2marks Ooad Notes Revised1

17 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

• Relevant classes: Relevant classes have a purpose. They are clearly defined and so they are necessary.• Fuzzy classes: Fuzzy classes are those classes which we are not sure about.• Irrelevant classes: These classes have no purpose and are unnecessary. It is safe to scrap these irrelevant classes.

4.What are the three steps in CRC process?The classes, responsibilities and collaborators process consists of three steps:

Identify classes’ responsibilities (and identify classes).Assign responsibilities.Identify collaborators.

5. How would you identify methods?The sequence diagrams assist us in defining services that the objects must provide. These

services are implemented as the methods for your objects. In a sequence diagram the events that occur between objects are drawn between the vertical object lines. An event is considered to be an action that transmits information; therefore these actions are the operations that the objects must perform. Methods also can be derived from the scenario testing.

6. Write the syntax for presenting the attribute that was suggested by UML.visibility name : type_expression = initial _valueWhere visibility is one of the following+ public visibility# protected visibility- private visibilitytype_expression - type of an attribute

7. Write the syntax for presenting the operation that was suggested by UMLvisibility name : (parameter_list): return _type_expressionWhere visibility is one of the following+ public visibility# protected visibility- private visibilityparameter- is a list of parameters.

Return_type_expression: is a language _dependent specification of the Implementation of the value returned by the method.

8. What are system sequence diagrams?A system sequence diagram (SSD) is a picture that shows, for a particular

scenario of a use case, the events that external actors generate, their order, and inter-system events. All systems are treated as a black box; the emphasis of the diagram is events that cross the system boundary from actors to systems.

9. What are the guide lines followed in design with layers?

L.Sagaya Desdemona/IT

Page 18: 2marks Ooad Notes Revised1

18 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

The essential ideas of using layers : Organize the large-scale logical structure of a system into discrete layers of distinct,related responsibilities,with a clean,cohesive separation of concerns such that the the lower layers are low-level and general services,and the higher layers are more application specific. Collaboration and coupling is from higher to lower layers; lower-to-higher layer coupling is avoided.

10. How high cohesion and separation of concerns helpful in layered architecture design? The responsibilities of the objects in a layer should be strongly related to each other and should not be mixed with responsibilities of other layers. For example,objects in the UI layer should focus on UI work,such as creating windows and widgets,capturing mouse and keyboard events,and so forth. Object in the application logic or “domain” layer should focus on application logic,such as calculating a sales total or taxes,or moving a piece on a game board.

11. What is the need for reverse engineering the source code to generate package diagrams?During early development,we may sketch a UML package diagram and then organize our

code according to these package sketches. Over time,the code base grows and we spend more time programming and less on modeling or UML diagrams. At tat point,a great use for a UML CASE tool is to reverse –engineer the source code and generate a package diagram automatically.

12. What are system events?Use cases describe how external actors interact with the software system we are

interested in creating. During this interaction an actor generates events to a system, usually requesting some operation in response. For example, when a cashier enters an item's ID, the cashier is requesting the POS system to record that item's sale. That request event initiates an operation upon the system.

13. What are system operations?It is desirable to isolate and illustrate the operations that an external actor requests of a

system, because they are an important part of understanding system behavior. The UML includes sequence diagrams as a notation that can illustrate actor interactions and the operations initiated by them.

14. What is the purpose of glossary? The terms shown in SSDs (operations, parameters, return data) are terse. These may need proper explanation so that during design work it is clear what is coming in and going out. If this was not explicated in the use cases, the Glossary could be used.

15. Define logical architecture.

L.Sagaya Desdemona/IT

Page 19: 2marks Ooad Notes Revised1

19 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

The logical architecture is the large scale organization of the software classes into packages(or name spaces),subsystems and layers. The logical architecture defines the packages within which software classes are defined. The logical architecture does not show how these elements are deployed across different operating system processes or across physical computers in a network. These are later decisions forming part of deployment architecture.

16. Define a layer.A layer is a very coarse-grained grouping of classes,packages,or subsystems that has

cohesive responsibility for a major aspect of the system. Layers are organized such that “higher” layers (such as UI layer call upon services of “lower” layers,but not normally vice versa.

17. Define the terms : a) Qualified Association ; b) Association Class ; c) Singleton class Qualified Association

A qualified association has a qualifier that is used to select an object (or objects) from a larger set of related objects, based upon the qualifier key.

Association ClassAn association class allows you treat an association itself as a class, and model it with

attributes, operations, and other features. Singleton Classes

There is only one instance of a class instantiated—never two. In other words, it is a “singleton” instance.

18. What does Interaction diagram represent?The UML includes interaction diagrams to illustrate how objects interact via messages.

They are used for dynamic object modeling. There are two common types: sequence and communication interaction diagrams.Sequence diagrams illustrate interactions in a kind of fence format, in which each new object is added to the right.Communication diagrams illustrate object interactions in a graph or network format, in which objects can be placed anywhere on the diagram.

19. Define Software Architecture.An architecture is the set of significant decisions about the organization of a software

system, the selection of the structural elements and their interfaces by which the system is composed,together with their behavior as specified in the collaborations among those elements, the composition of these structural and behavioral elements into progressively larger subsystems.,

20. What are UML Package Diagrams?A UML package diagram provides a way to group elements such as classes,other packages,use cases and so on. Nesting packages is also common. UMl package is more general concept than simply a Java package or .NET namespace.

21 . What does an UML dependency line represent?

L.Sagaya Desdemona/IT

Page 20: 2marks Ooad Notes Revised1

20 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

Dependency relationship indicates that one element (of any kind, including classes, use cases, and so on) has knowledge of another element.

A dependency is a using relationship that states a change in specification of one thing may affect another thing that uses it, but not necessarily the reverse. The dependency relationship is useful to depict non-attribute visibility between classes. Parameters Global or local visibility A dashed arrow line A dashed directed line

22. What are the benefits of using layers?There is a separation of concerns, a sepeartation of higher from low level services and the application- specific from general services. This reduces coupling and dependenciesImproves cohesionIncreases reuse potential andIncreases clarityDeployment of teams is aided because of the logical segmentation.

23. Define domain object. Domain objects are software objects with names and information similar to the real world domain ; Application logic responsibilities are assigned to them. For example,in the real world of POS,there are sales and payments. So,in software ,we create a Sale and Payment Class,and give them application logic responsibilities.

24. What is a domain layer? Domain layer contains domain objects to handle application logic work.

25. What are tiers,layers and partitions?The original notion of tier in architecture was a logical layer,not a physical node.

The layers of an architecture represent the vertical slices,while partitions represent a horizontal division of relatively parallel subsystems of a layer.For example ,the Technical services layer may be divided into partitions such as Security and Reporting.

26. What is model view separation principle. The Model-View-Seperation-Principle states that model (domain) objects should not have direct knowledge of view(UI) objects.For example,a Register or Sale object should not directly send a message to a GUI window object ProcessSaleFrame,asking it to display something,change color,close,and so forth.

27. What are the motivations for this principle?The motivation for Model-View Separation includes:

To support cohesive model definitions that focus on the domain processes, rather than on user interfaces.To allow separate development of the model and user interface layers.

L.Sagaya Desdemona/IT

Page 21: 2marks Ooad Notes Revised1

21 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

To minimize the impact of requirements changes in the interface upon the domain layer.To allow new views to be easily connected to an existing domain layer, without affecting the domain layer.To allow multiple simultaneous views on the same model object, such as both a tabular and business chart view of sales information.To allow execution of the model layer independent of the user interface layer, such as in a message-processing or batch-mode system.To allow easy porting of the model layer to another user interface framework.

28. How to show methods in class diagrams?A UML method is the implementation of an operation; if constraints are defined, the method must satisfy them. A method may be illustrated several ways, including: in interaction diagrams, by the details and sequence of messages, in class diagrams, with a UML note symbol stereotyped with «method»

29. What are strength and weaknesses of Sequence and Communication diagrams? Sequence :Strengthsclearly shows sequence or time ordering of messages large set of detailed notation optionsWeaknessesforced to extend to the right when adding new objects; consumes horizontal spacecommunication :Strengthsspace economical—flexibility to add new objects in two dimensionsWeaknessesmore difficult to see sequence of messages fewer notation options

30. What is Design class diagram?It can explored, the same UML diagram can be used in multiple perspectives. In a

conceptual perspective the class diagram can be used to visualize a domain model. A unique term to clarify when the class diagram is used in a software or design perspective is called design class diagram , and all form part of the Design Model. Other parts of the Design Model include UML interaction and package diagrams.

31. What is UML classifier?A UML classifier is “a model element that describes behavioral and structure features”

Classifiers can also be specialized. They are a generalization of many of the elements of the UML, including classes, interfaces, use cases, and actors. In class diagrams, the two most common classifiers are regular classes and interfaces.

32. What are the ways to show UML attributes?Attributes of a classifier (also called structural properties in the UML) are shown several ways:attribute text notation, such as currentSale : Sale. association line notationboth together

L.Sagaya Desdemona/IT

Page 22: 2marks Ooad Notes Revised1

22 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

UNIT-IV

1. Define transient data? Give some transient data?Transient data are those data that cease to exist beyond the lifetime of thecreating

process. Some categories of transient data are: Transient results to the evaluation of expressions. Variables involved in procedure activation (parameters and variables with a localized scope.) Global variables and variables that are dynamically allocated.

2. What are the essential elements in providing a persistent store?Essential elements in providing a persistent store are:

Identification of persistent objects or reachabilityProperties of objects and their interconnections.Scale of the object store.Stability.

3. Define schema or meta-data?Schema or meta-data contains a complete definition of the data formats, such as the data

structures, types and constraints. The meta-data are usually encapsulated in the application programs themselves. In DBMS, the format of the meta-data is independent of any particular application data structure; therefore it will provide a generic storage management mechanism.

4. What is meant by database model? Give the different database models.A database model is a collection of logical constructs used to represent the data structure

and data relationships within the database. The different database models are,Hierarchical modelNetwork modelRelational model

5.What are the three basic types of attributes?The three basic types of attributes are

Single-value attributes.The single-valued attribute has only one value or state.

Multiplicity or multi value attributes.The multiplicity or multi valued attribute can have a collection ofmany values at any

point in time. Reference to another object, or instance connection. These attributes are required to provide the mapping needed by anobject to fulfill its responsibilities, in other words, instance connection model association.

6. What are some characteristics of a bad design?The five rules are,

If it looks messy, then it’s probably a bad design. If it is too complex, then it’s probably a bad design. If it is too big, then it’s probably a bad design. If people don’t like it, then it’s probably a bad design. If it doesn’t work, then it’s probably a bad design.

L.Sagaya Desdemona/IT

Page 23: 2marks Ooad Notes Revised1

23 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

7. What are patterns?In Object Oriented Design,a pattern is a named description of a Problem and  Solutions

that can be applied to new contexts. Many patterns,given a category of problem,guide the assignment of responsibilities to objects.

8. What are Design Patterns?In software engineering, a design pattern is a general repeatable solution to a commonly

occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.

9. What is GRASP? GRASP is an acronym for ‘General Responsibility Assignment Software Patterns’.GRASP provides guidance for assigning responsibilities to classes and, to a limited extent, determining the classes that will be in a design in an object-oriented system. In short GRASP stands for designing objects with responsibilities

10. What are GRASP principles?The GRASP principles or patterns are a learning aid to help you understand essential object design in a methodical,rational,explainable way. This approach is based on patterns of assigning responsibilities.

11. What are the nine OOD principles?GRASP defines nine basic Object Oriented Design principles or basic building blocks in design.Information Expert.CreatorControllerLow couplingHigh CohesionPolymorphismPure fabricationIndirectionProtected variations12. What are the necessary characteristics that a system must satisfy to be considered as an object-oriented system?

The rules that make a system an object-oriented system are:The system must support complex objects.Object identity must be supported.Objects must be encapsulated.The system must support types or classes.The system must support inheritance.The system must avoid premature binding.The system must be computationally complete.The system must be extensible.

L.Sagaya Desdemona/IT

Page 24: 2marks Ooad Notes Revised1

24 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

13. Differentiate object-oriented databases and traditional databases? The objects are an active component in an object-oriented database, in contrast to

conventional database systems, where records play a passive role. The relational database systems do not explicitly provide inheritance of attributes and methods while object-oriented databases represent relationships explicitly. Object oriented databases also differ from the traditional relational databases in that they allow representation and storage of data in the form of objects.

14. Describe reverse and forward engineering?Creating an object model from an existing relational database layout (schema) often is referred to as reverse engineering.Creating a relational schema from an existing object model often is referred to as forward engineering.

15. Define object-relation mapping?In a relational database, the schema is made up of tables, consisting of rows and columns. In an object model, the counterpart to a table is a class which has a set of attributes (properties or data members) and methods (behaviors). The object- relation mapping is the mappings between a table and a class that is the mappings between columns and attributes, between a row and an object, and between a stored procedure and a method.

16. What are the different mapping capabilities to be defined?The mapping capabilities that must be defined are:

Table-class mapping.Table-multiple classes mapping.Table-inherited classes mapping.Tables-inherited classes mapping.

17. Define referential integrity?Referential integrity means making sure that a dependent table’s foreign keycontains a

value that refers to an existing valid tuple in another relation.

18. What do you mean by federated multidatabase systems?Federated multidatabase systems are the heterogeneous information systems which facilitated the integration of heterogeneous information sources, where they can be structured, semi-structured and sometimes even unstructured. Some heterogeneous information systems are constructed on a global schema over several databases.

19. What is GOF?GOF refers to the four authors(Gamma,Helm,Johnson,and Vlissides) known as the 

Gang-of-four who have written a book “design Patterns” which is considered as Bible of design pattern books. The book describes 23 patterns for Object Oriented Design

20. What is Responsibility Driven Design approach?

L.Sagaya Desdemona/IT

Page 25: 2marks Ooad Notes Revised1

25 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

In this the design of Software Objects as having responsibilities – an abstraction of what they do. The UML defines a responsibility as “a Contract or Obligation of a Classifier”, knowing responsibility and doing it.

21. Explain ‘Low Coupling’ with an example.Low CouplingCoupling is a measure of how strongly one element is connected to, has knowledge of, or relies on other element.Low Coupling PatternProblem: How to support a low dependency,low change impact ,and increased reuse?Solution: Assign a responsibility so that coupling remains low.

22. What is Visibility?Visibility is the ability of one object to see or have reference to another.

In common usage, visibility is the ability of an object to "see" or have a reference to an -other object. More generally, it is related to the issue of scope: Is one resource (such as an instance) within the scope of another?

23.Write short notes on a)Attribute visibility b)Parameter Visibility c)Local visibility d)Global visibilityThere are four common ways that visibility can be achieved from object A to object B:Attribute visibility B is an attribute of A.Parameter visibility B is a parameter of a method of A.Local visibility B is a (non-parameter) local object in a method of A.Global visibility B is in some way globally visible.

24. Define High Cohesion?

High Cohesion is an evaluative pattern that attempts to keep objects appropriately focused, manageable and understandable. High cohesion is generally used in support of Low Coupling. High cohesion means that the responsibilities of a given element are strongly related and highly focused. Breaking programs into classes and subsystems is an example of activities that increase the cohesive properties of a system.

25. Define Creator?Creation of objects is one of the most common activities in an object-oriented system.

Which class is responsible for creating objects is a fundamental property of the relationship between objects of particular classes.

26. What is Observer pattern?

The observer pattern (a subset of the publish/subscribe pattern) is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems.

L.Sagaya Desdemona/IT

Page 26: 2marks Ooad Notes Revised1

26 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

27. What is Responsibility-Driven Design?A popular way of thinking about the design of software objects and also larger scale

Components 3 are in terms of responsibilities, roles, and collaborations. This is part of a larger approach called responsibility -driven design or RDD.

28. What is Responsibilities?The UML defines a responsibility as ―a contract or obligation of a classifier.

Responsibilities are related to the obligations or behavior of an object in terms of its role.

29. What are the two responsibilities?The responsibilities are of the following two types: doing and knowing.

Doing responsibilities of an object include:• doing something itself, such as creating an object or doing a calculation• initiating action in other objects ,controlling and coordinating activities in other objects

Knowing responsibilities of an object include:• knowing about private encapsulated data• knowing about related objects• knowing about things it can derive or calculate

30. Define Pattern?A pattern is a named problem/solution pair that can be applied in new context, with

advice on how to apply it in novel situations and discussion of its trade-offs

31. What is Controller?The Controller pattern assigns the responsibility of dealing with system events to a non -UI

class that represent the overall system or a use case scenario. A Controller object is a non -user interface object responsible for receiving or handling a system event.

32. What is Information Expert?Information Expert is a principle used to determine where to delegate responsibilities.

These responsibilities include methods, computed fields and so on. Using the principle of Information Expert a general approach to assigning responsibilities is to look at a given responsibility, determine the information needed to fulfill it, and then determine where that information ion is stored. Information Expert will lead to placing the responsibility on the class with the most information required to fulfill it

33. What is singleton pattern?The singleton pattern is a design pattern used to implement the mathematical concept of a

singleton, by restricting the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.

34. What is adapter pattern?The adapter pattern is a design pattern that translates one interface for a class into a

compatible interface. An adapter allows classes to work together that normally could not because

L.Sagaya Desdemona/IT

Page 27: 2marks Ooad Notes Revised1

27 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter is also responsible for transforming data into appropriate forms.

35. What is Facade Pattern?A facade is an object that provides a simplified interface to a larger body of code, such as

a class library. A facade can:• make a software library easier to use, understand and test, since the facade has convenient methods for common tasks;• make code that uses the library more readable, for the same reason;• reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system;• Wrap a poorly-designed collect ion of APIs with a single well-designed API (as per task needs).

UNIT-V

1. What are the steps in view layer macro process?The view layer macro process consists of two steps:

For every class identified, determine if the class interacts with a humanactor. If so, perform the following; otherwise, move to the next class. Identify the view (interface) objects for the class. Define the relationships among the view (interface) objects. Iterate and refine

2. Give the three UI design rules.UI design rule 1: Making the interface simple.UI design rule 2: Making the interface transparent and natural.UI design rule 3: Allowing users to be in control of the software.

3. What are the activities involved in access layer design process?The process of creating an access class for the business classes is as follows:For every business class identified, mirror the business class package.Define relationships.Simplify classes and relationships.Iterate and refine.

4. Define axiom? What are the two design axioms applied to object-oriented design?An axiom is a fundamental truth that always is observed to be valid and for which there is

no counterexample or exception. The axioms cannot be proven or derived but they cannot be invalidated by counterexamples or exceptions. There are two design axioms applied to object-oriented design. Axiom 1 deals with relationships between system components and Axiom 2 deals with the complexity of design.Axiom 1: The independence axiom. Maintain the independence of components.Axiom 2: The information axiom. Minimize the information content of the design.

L.Sagaya Desdemona/IT

Page 28: 2marks Ooad Notes Revised1

28 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

5. Define corollary? Give the corollaries derived from design axioms. (or) List the various design rules?A corollary is a proposition that follows from an axiom or anotherproposition that has been proven. A corollary is shown to be valid if its referent axioms and deductive steps are valid. The design rules or corollaries derived from design axioms are stated below.Corollary 1: Uncoupled design with less information content.Corollary 2: Single purpose.Corollary 3: Large number of simple classes.Corollary 4: Strong mapping.Corollary 5: Standardization.Corollary 6: Design with inheritance.

6. What is Test driven development?Test-Driven or Test-First Development

An excellent practice promoted by the Extreme Programming method , and applicable to the UP and other iterative methods . In this practice, unit testing code is written before the code to be tested, and the developer writes unit testing code for all production code. The basic rhythm is to write a little test code, then write a little production code, make it pass the test, then write some more test code, and so forth.

7. What are deployment diagrams?Deployment Diagrams

A deployment diagram shows the assignment of concrete software artifacts (such as executable files) to computational nodes (something with processing services). It shows the deployment of software elements to the physical architecture and the communication (usually on a network) between physical elements.

8. Definitions: Transition with an example?A transition is a relationship between two states that indicates that when an event occurs,

the object moves fro m the prior state to the subsequent state. For example: When the event \"off hook\" occurs, transition the telephone from the \"idle\" to \"active\" state.

9. What is State-Independent and State-Dependent Objects?If an object always responds the same way to an event, then it is considered state-

independent (or mode less) with respect to that event. If for all events of interest, an object always reacts the same way, it is a state-independent object. By contrast state-dependent objects react differently to events depending on their state or mode.

10. What are UML state machine diagrams?A UML statechart diagram, illustrates the interesting events and states of an object, and

the behavior of an object in reaction to anevent. Transitions are shown as arrows, labeled with their event. States are shown in rounded rectangles.

11. Define events,states,and transitions? An event is a significant or noteworthy occurrence. For example: A telephone receiver is taken off the hook.

L.Sagaya Desdemona/IT

Page 29: 2marks Ooad Notes Revised1

29 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

A state is the condition of an object at a moment in time—the time between events. For example: • A telephone is in the state of being "idle" after the receiver is placed on the hook and until it is taken off the hook. A transition is a relationship between two states that indicates that when an event occurs,

the object moves from the prior state to the subsequent state. Forexample: When the event "off hook" occurs, transition the telephone from the "idle" to "active" state.

12. What is transition action?A transition can cause an action to fire. In a software implementation, this may represent

the invocation of a method of the class of the statechart diagram.

13. What is guard condition?

A transition may also have a conditional guard—or boolean test. The transition only occurs if the test passes.

14. What are nested states? A state allows nesting to contain substates; a substate inherits the transitions of its superstate (the enclosing state). This is a key contribution of the Harel state-chart diagram notation that UML is based on, as it leads to succinct statechart diagrams. Substates may be graphically shown by nesting them in a superstate box.

15. What are operation contracts?Operation contracts use a pre- and post-condition form to describe detailed changes to

objects in a domain model, as the result of a system operation. A domain model is the most common OOA model, but operation contracts and state modelscan also be useful OOA-related artifacts.Operation contracts may be considered part of the UP Use-Case Model because they provide more analysis detail on the effect of the system operations implied in the use cases.

16. Explain operation contract with an example.ExampleHere's an operation contract for the enterItem system operation. The critical element is the postconditions; theother parts are useful but less important.Contract CO2: enterItemOperation: enterItem(itemID: ItemID, quantity: integer)Cross References: Use Cases: Process SalePreconditions: There is a sale underway.Postconditions:- A SalesLineItem instance sli was created (instance creation).- sli was associated with the current Sale (association formed).- sli.quantity became quantity (attribute modification).- sli was associated with a ProductDescription, based on itemID match(association formed).

L.Sagaya Desdemona/IT

Page 30: 2marks Ooad Notes Revised1

30 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

The categorizations such as "(instance creation)" are a learning aid, not properly part of the contract.

17. What are post conditions? Describe changes in the state of objects in the domain model that are true when the operation has finished.They are not actions to be performed during the operation

Postconditions fall into these categories :1. Instance creation and deletion2. Attribute modification3. Associations (UML links) formed and broken.

18. Explain guidelines for how to create and write contracts?Apply the following advice to create contracts:

1. Identify system operations from the SSDs. For system operations that are complex and perhaps subtle in their results, or which are not clear in the use case, construct a contract. 2. To describe the postconditions, use the following categories:

instance creation and deletionattribute modificationassociations formed and broken

3. Writing ContractsWrite the postconditions in a declarative, passive past tense form (was …) to

emphasize the observation of a change rather than a design of how it is going to be achieved.

19. What is an implementation model?In UP terms, there exists an Implementation Model. This is all the implementation

artifacts, such as the source code, database definitions, JSP/XML/HTML pages, and so forth. Thus, the code being created in this chapter can be considered part of the UP Implementation Model.

20. Define Database Models And explain the categories.A database model is a collect ion of logical constructs representing the data structure and

data relationship within the database.Database models is of two categories1. Conceptual model2. Implementation modelConceptual Model: Focuses on logical nature of data. It deals with what is represented in the database.Implementation Model: is concerned with how it is represented.

21. Definitions: Events with example?An event is a significant or noteworthy occurrence. For example:• A telephone receiver is taken off the hook.

L.Sagaya Desdemona/IT

Page 31: 2marks Ooad Notes Revised1

31 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

22. Definitions: States with an example?A state is the condition of an object at a moment in time the time between events. For example:• A telephone is in the state of being \"idle\" after the receiver is placed on the hook and until it is taken off the hook.

23. What are the steps involved in mapping design to code? Implementation in an object-oriented language requires writing source code for:class and interface definitions method definitions

24. Wite short notes on a) Exception and error handling The main focus was on responsibility assignment and object design. But during

implementation phase we need to consider the large-scale exception handling strategies during design modeling.The operation syntax allows to specify how exceptions are to be handles :

Example :+ getPlayer( name : string ) : Player {exception IOException}Public Player getplayer(string name_ throws exception)

25. What are the basic elements of deployment diagrams?The basic element of a deployment diagram is a node, of two types:device node (or device) A physical (e.g., digital electronic) computing resource with processing and memory services to execute software, such as a typical computer or a mobile phone.execution environment node (EEN) This is a software computing resource that runs within an outer node (such as a computer) and which itself provides a service to host and execute other executable software elements.

26. Define a component.A component represents a modular part of a system that encapsulates its contents and

whose manifestation is replaceable within its environment. A component defines its behavior in terms of provided and required interfaces. As such, a component serves as a type, whose conformance is defined by these provided and required interfaces

27 . What is Component Diagrams?

The Component Diagram helps to model the physical aspect of an Object -Oriented software system. It illustrates the architectures of the software components and the dependencies between them. Those software components including run-time components, executable components also the source code components.

28. Write the attribute presentation suggested by UML?OCL can be used during the design phase to define the class attributes .The follo wing is

the attribute presentation suggested by UML.Visibility name: type –expression-initial-value where visibility is+ public visibility# protected visibility

L.Sagaya Desdemona/IT

Page 32: 2marks Ooad Notes Revised1

32 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

- private visibilityType – expression is language dependent specification .Initial – value is language dependent expression for the initial value of a newly created object.

29. What are the 3 relationships that can be shown in UM L diagram? Define them.1. Association how are objects associated? This information will guide us in designing classes.2. Super-Sub Structure How are objects organized into super classes and sub classes? This information provides us the direction of inheritance.3. Aggregation and a part of Structure what is the composition of complex.

30 .Example of state diagram?

31. Give an example for guard condition?

32. Give example of sequence diagram

L.Sagaya Desdemona/IT

Idle

Initial state

Activeoff hook

on hook

transitionevent state

Idle Activeoff hook / play dial tone

on hook

event

[ valid subscriber ]

action

guard condition

Page 33: 2marks Ooad Notes Revised1

33 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

33. Give the example of collaboration diagram?

34. Give an example of component diagram?

35. Give an example of deployment diagram ?

L.Sagaya Desdemona/IT

policy.dll

BranchBank.dllcustomer.dll

ATM.exe

BranchBank.exe

BankServer.exe

ATM_machine

Bank_server

BranchBank_

Ethernet EthernetBank.exe

BankServer.exeATM.exe

Page 34: 2marks Ooad Notes Revised1

34 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

16 MARKS

UNIT I

1. Explain Types of UML Diagrams with example? 2. Explain Unified Phase and their types with an example? 3. Explain CASE STUDY: THE NEXTGEN POS SYSTEM? 4. Explain Use Case Modeling With example? 5. Explain about Inception in detail?6. Explain with an example, how use case modeling is used to describe functional

requirements. Identify the actors, scenario and use cases for the example.7. Explain about generalization for the banking system.

UNIT II

1. Explain about Elaboration?2. Explain Domain Models with an example? 3. Explain Conceptual Classes with an example and what are Three Strategies to Find

Conceptual Classes? 4. Explain Descriptions with the Airline Domain example? 5. Explain Associations with Applying UML? 6. Explain Attribute with Applying UML? 7. What are Suitable Attribute Types? Explain Focus on Data Type Attributes in the

Domain Model.

8. Explain Conceptual Superclasses and Subclasses with an example? 9. Explain Aggregation and Composition? 10. Explain UML Activity Diagrams and Modeling? 11. Explain about activity diagram with an example.

UNIT III

1. Explain System sequence diagrams with an Example? 2. Explain logical architecture and UML package diagrams? 3. What\'s the Connection Between SSDs, System Operations, and Layers? 4. Explain Logical architecture refinement? 5. Explain UML class diagrams? 6. Explain Inter-Layer and Inter-Package Interaction? 7. Explain UML Interaction Diagrams?

L.Sagaya Desdemona/IT

Page 35: 2marks Ooad Notes Revised1

35 CS2353 OBJECT ORIENTED ANALYSIS AND DESIGN

8. Explain Operations and Methods with an example? 9. Illustrate with an example, the relationship between sequence diagram and use cases.

UNIT IV

1. Explain GRASP: Designing objects with responsibilities 2. Explain GoF DESIGN PATTERNS 3. Explain Creator and Information Expert with an Example? 4. Explain Low Coupling and Controller with an Example? 5. Explain adapter and singleton with an example? 6. Write short notes on factory and observer patterns.

UNIT V

1. Explain UML state diagrams with an example? 2. Explain Operation contracts with an example? 3. Explain Mapping design to code with an Example? 4. Explain UML deployment diagrams with an example? 5. Explain UML component diagrams with an example? 6. Explain about implementation model?7. Draw the state , deployment and component diagram for a banking application

L.Sagaya Desdemona/IT