OOMD VIVA Questions What are traditional development methodologies? Most traditional development methodologies are either algorithm centric or data centric. In an algorithmic centric methodology, you think of an algorithm that can accomplish the task, and then build data structures for that algorithm to use. In data data cent centri ricc meth method odol ology ogy,, you you thin think k how how to stru struct ctur uree the the data data,, and then then build build algorithms around that structure. What is Object Oriented development methodology? In obje object ct orie orient nted ed envi enviro ronm nment ent,, soft softwa ware re is a coll collec ecti tion on of disc discre rete te obje object ctss that that encapsulate their data and the functionality to model the real world “objects”. The object oriented life cycle encourages a view of the world as a system of cooperative and collaborating agents. Define an object n object is an instance of a class. n object is the combination of data and logic that represents some real world entity. entity. n object has identity, state, and behavior. What is a class? group of objects having common structure and behavior is called a class. class is also called an object template from which objects can be created. !lasses are important mechanism for classifying objects. What is a method? In the object model, object behavior is described in methods or procedures. "asically a method is a function or procedure that is defined for a class. Methods encapsulate the behavior of the object, provide interfaces to the object, and hide any of the internal structures and states maintained by the object. Meth Method odss are are simi simila larr to funct functio ions ns,, proc proced edur ures es,, or subr subrout outin ines es in more more tradi traditi tiona onall programming languages, such as !#"#$, "asic or !. !o" messages are different from methods? Messag Messages es essent essential ially ly are non%spe non%specif cific ic functi function on calls. calls. message message is differ different ent from from a subroutine call, since different objects can responds to same message in different ways. message differs differs from function in that a function says how to do something and message says what to do. What is the distinction bet"een traditional development methodologies and object oriented development methodologies? Tradi Traditio tional nal approa approach ch focuse focusess on functi functions ons of the syste system m where where as object object orient oriented ed approach centers on object which is the combination of data and functionality. What are the advantages of object oriented approach? a&'igher levels of abstraction b&(eamless transition among different different phases of software development
c&)ncouragement of good programming techni*ues d&+romotion of reusability What is #nified Approach$#A%? is based on methodologies by "ooch, -umbaugh,and acobson which combines best practices, processes, and guidelines along with #M/0s nified Modeling $anguage1M$& What is the heart of #A? The heart of is acobson0s se case. The use case represents a typical interaction between a user and a computer system to capture the user0s goals and needs. What is class hierarchy? n ## system organi2es classes into a super class%subclass hierarchy. t the top of the class hierarch are the most general classes and at the bottom are the most specific. subclass inherits all of the properties and methods 1procedures& defined in its super clas class. s. (ubcl (ubclas asse sess usual usually ly add add new new meth methods ods and prope propert rtie iess spec specif ific ic to that that clas class. s. (ubclasses may refine or constrain the state and behavior inherited from its super class. What is inheritance? Inheritance is the property of ## systems that allows objects to be built from other objects. objects. Inheritance Inheritance is a relationshi relationship p between between classes classes where one class is the parent class of another 1derived& class. The parent class is also known as the base class or super class. What is &olymorphism? +oly means “many” and morph means “form”. +olymorphism means the same operation may behave differently on different classes. What is association? Association represents the relationship between objects and classes.
What is multiple inheritance? When one class inherits its state (attributes) and behavior from more than one super class, it is referred referred to as multiple inheritances. What is dynamic binding? The process of determining determining (dynamically) at a t run time which functions to invoke is termed dynamic binding. What is static binding? The process of determining determining at compile time which functions to invoke is termed static binding. Write the four quality measures for software development? Correspondence, Correspondence, correctness, verication, and validation.
What is object persistence? b!ects have life time. They are created and can e"ist for a period of time. # le or a database can provide support for ob!ects having a longer life time time long longer er than than the the dura durati tion on of the the proc proces ess s for for whic which h they they wer were created. This characteristic is called ob!ect persistence. What is cardinality? cardinality? Cardinality species how many instances of one class may relate to a single instance of an associated class. What is a formal class or abstract class? $ormal or abstract classes have no instances but dene the common behaviors that can be inherited by more specic classes. What is a meta-class? # meta meta%c %cla lass ss is a clas class s about about a clas class. s. They They are are nor normall mally y us used ed to provide instance variables and operations. Dene Encapsulation? Encapsulation? &ncapsulation is the process of compartmentali'ing the elements of an abstraction that constitute its structure and behavior. behavior. What is the need of an Object diagram? #n ob!ect diagram is used to show the e"istence of ob!ects and their relationships in the logical design of a system. '(plain object relationship and associations a. ssociation ssociation represents the relationships between objects and classes. b. ssociations ssociations are bidirectional. c. !ardinality specifies how many instances of one class may relate to a single instance of an associated class. d. !ardinality constraints the number of related objects and often is described as being “one” or “many” Define collaboration The object%orie object%oriented nted programming programming community community has adopted adopted use%cases use%cases to a remarkable remarkable degree. (cenarios are a great way of e3amining who does what in the interactions among objects and what role they play4 that is their interrelationships. This intersection among objects0 roles to achieve a given goal is called collaboration. Why do "e go for object oriented systems development? The motivatio motivation n factor factor behind object%orient object%oriented ed system system development development is the desire to make software development easier and more natural by raising the level of abstraction to the point where the level of abstraction to the point where applications can be implemented in the same terms n which they are described by users.
Write about the four phases in OM)? #MT consists of four phases. They are 5 nalysis%The results are objects and dynamic 6 functional models. 5 (ystem (ystem design%The design%The results results are a structure structure of the basic architecture architecture of the system along with high%level strategy decisions. 5 #bject #bject 7esign 7esign%+r %+rodu oduces ces a design design docume document, nt, consis consisti ting ng of detail detailed ed object objectss static static,, dynamic and functional models 5 Implementation%This activity produces reusable, e3tendible, robust code. What do you mean by object diagram? The object model of #MT is represented graphically with an object diagram. The object diagram contains classes interconnected by association lines. )ach class represents a set of individual objects. The association lines establish relationships among the classes. )ach association line represents a set of links from the objects o f one class to the objects of another class What are the diagrams used in *ooch methodology? The "ooch methodology consists co nsists of the following diagrams8 !lass diagrams. #bject diagrams. (tate transition diagrams. Module diagrams. +rocess diagrams. Interaction diagrams +ive the steps involved in Macro development process in *ooch methodology . The macro development process consists of the following steps8 o !onceptuali2ation )stablish the core re*uirements and develop a prototype. o nalysis and development of the model se the class diagram to describe the roles and responsibilities of objects. se the object diagram to describe the desired behavior of the system. o 7esign or create the system architecture. se the class diagram to decide what classes e3ist and how they relate to each other, the object diagram to decide what mechanisms are used, the module diagram to map out where each class and object should be declared, and the process diagram to determine to which processor to allocate a process. o )volution or implementation% -efine the system through much iteration. o Maintenance%Make locali2ed changes to the system to add new re*uirements and eliminate bugs. +ive the steps involved in Micro development process in *ooch methodology
The micro process is a description of the day%to%day activities by a single or small group of software developers. It consists of the following steps. o Identify classes and objects. o Identify class and object semantics. o Identify class and object relationships. Write briefly about #se ,ases se se case casess are are scen scenar ario ioss for for under underst stan andi ding ng syst system em re*u re*uir irem ement ents. s. use use case case is an interaction between users and a system. The use%case model captures the goal of the user and the responsibility of the system to its users. The use%case model employs e3tends and uses relationships. The use cases are described as one of the following8 9onformal te3t with no clear flow of events Te3t Te3t with a clear flow of events :ormal style using pseudo code. Define patterns 7esign pattern identifies the key aspects of a common design structure that makes it useful useful for creati creating ng a reusab reusable le object object%or %orien iented ted design design.. :urthe :urtherm rmore, ore, it identi identifie fiess 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 conse*uences and trade%offs of its use. pattern is an instructive information that captures the essential structure and insight of a successful successful family of proven solutions solutions to a recurring recurring problem that arises arises within within a certain certain conte3t and system of forces. Define frame "or- +ive the differences bet"een design patterns and frame"or-s frame work is a way of presenting a generic solution to a problem that can be applied to all all level levelss in a devel developm opment ent.. :ram :ramew ewor orks ks are are a way way of deli delive veri ring ng appl applic icat atio ion n development patterns. framework provides architectural guidance, captures the design decisions that are common to its application domain and thus emphasi2e design reuse over code reuse. The major differences between design patterns and frameworks are as follows8 framework framework is e3ecutable software whereas wh ereas design patterns represent knowledge and e3perience about the software. 7esign patterns are more abstract than frameworks. 7esign patterns are smaller architectural elements than frameworks. 7esign patterns are less speciali2ed than frameworks. Define model '(plain about the types of model model is an abstract abstract representation representation of a system, system, constructed constructed to understand the system system prior to building or modifying it. It is a model of a simplified representation of reality. reality. Models can represent static or dynamic situations. 5 .tatic model o It can be viewed as a snapshot of a system0s parameters at rest or a specific point in time. They are needed to represent the structural or static aspect of a system. The M$ class diagram is an e3ample of static model.
5 Dynamic model o It can be viewed as a collection of procedures or behaviors that taken together reflect the behavior of a system over time. 7ynamic modeling is the most useful during the design and implementation phases of the system development. The M$ interaction diagrams and activity models are e3amples of dynamic models. What are the advantages of Modeling? /ood models are essential for communication among project teams. s the comple3ity of systems increases, so does the importance of good modeling techni*ues. (ome of the advantages are as follows8 Models make it easier to e3press comple3 ideas. The main reason for modeling is to reduction of comple3ity. Models enhance and reinforce learning and training. The The cost cost of mode modeli ling ng anal analy ysis sis is much much lowe lowerr than than the the cost cost of sim similar ilar perimentation conducted in real system. Manipulation of the model is much easier. +ive the nine #M/ graphical diagrams a. !lass diagram1static& b. se%case diagram c. "ehavior diagram1dynamic& i. Interaction diagram ;. (e*uence diagram <. !ollaboration diagram ii. (tate chart diagram iii. ctivity diagram d. Implementation diagram. i. !omponent diagram ii. 7eployment diagram. What is a &ac-age? pack packag agee grou groups ps and and mana manage gess the the mode modeli ling ng elem elemen ents ts,, such such as clas classe ses, s, thei their r associ associati ations ons,, and their their struct structure ures. s. +ackag +ackages es thems themselv elves es may be nested nested within within other other packages. Define use0case se cases are scenarios that describe how actors use the system. use case is an inte intera ract ctio ion n betw betwee een n user userss and a syst system em.. It capt captur ures es the the goal goal of the the user userss and and the the responsibility of the system to its users. acobsons0 definition of use case is, “ use case is a se*uence of transactions in a system whose task is to yield results of measurable value to an individual actor of the system.” When 1e(tends2 association is used? The =e3tends0 association is used when you have one use case that is similar to another use case but does a bit more or is more speciali2ed. It is like a subclass. )3tends association is utili2ed to e3pand the common behavior to fit the special circumstances.
Define 1uses2 association The uses association occurs when some of the use cases have subflows in common. 'ere to avoid describing a subflow more than once in several use cases, the common subflow can be e3tracted and made into a new use case of its own. The relationship among the other use cases and this new e3tracted use case is called a uses association. >hen you want to share common se*uences in several use cases, utili2e the uses association by e3tracting common se*uences into a new, shared use case. The uses association helps us to avoid redundancy by allowing a use case to be shared. What is ,3,? !lasses, responsibilities, and collaborators is a techni*ue used for identifying classes0 resp respon onsi sibi bili liti ties es,, and and colla collabor borat ator orss and ther theref efor oree thei theirr attr attrib ibut utes es and and meth method ods. s. :urthermore, !-! can help us identify classes. !-! is based on the idea that an object either can accomplish a certain responsibility itself or it may re*uire the assistance of other objects. Why do "e need to identify the system2s responsibilities? >e need to identi identify fy the syste system0 m0ss respon responsib sibili iliti ties es because because respon responsib sibili ilitie tiess identi identify fy problems that are to be solved. responsibility responsibility serves as a handle for discussing potential solutions. #nce the system0s responsibilities are understood we can start identifying the attributes of the system0s system0s classes. What do you mean by coupling? !oupling is a measure of the strength of association established by a connection from one object or software component to another. !oupling is a binary relationship. :or e3ample is coupled with ". !oupling is important when evaluating a design because it helps us focus on an important issue in design. What do you mean by degree of coupling? The degree of coupling is a function of 'ow complicated the connection is. >hether >hether the connect connection ion refers refers to the object itself itself or somethi something ng inside inside it. >hat >hat is being being sent sent or received. The degree or strength of coupling between two components is measured by the amount and comple3ity of information transmitted between them. !oupling increases with increasing comple3ity and decreases when the connection is to the component inte interf rfac acee rath rather er than than to an inte intern rnal al comp compone onent nt.. !oupl !ouplin ing g is also also lowe lowerr for for data data connections than for control connections. What are the t"o types of coupling? #bject oriented design has two types of coupling. They are, Interaction coupling Interaction coupling involves the amount and comple3ity of messages between components. It is desirable to have little interaction. ? Inheritance coupling Inheritance is a form of coupling between super and subclasses. subclass is coupled to its super class in terms of attributes and methods.
nlike interaction coupling, high inheritance coupling is desirable. What do you mean by cohesion? +ive the types of cohesion !ohesion can be defined as the interactions within a single object or software component. !ohesion reflects the “single%purpose ness” of an object. !ohesion helps in designing classes that have very specific goals and clearly defined purposes. Method cohesion method should carry only one function. ,lass cohesion ll the class0s methods methods and attributes must be used by internal methods or derived classes0 methods. Inheritance cohesion !oncerned with how classes are interrelated. Differentiate coupling and cohesion? !oupling deals with interactions between objects or software components while cohesion deals with the interactions within a single object or software component. 'ighly cohesive components can lower coupling because only a minimum of essential information need to b passed between components. What are some characteristics of a bad design? The five rules are, If it looks messy, messy, then it0s probably a bad design. If it is too comple3, then it0s probably a bad design. If it is too big, then it0s probably a bad design. If people don0t like it, then it0s probably a bad design. If it doesn0t work, then it0s probably a bad design. Describe 3umbaugh2s Object Modeling )echni4ue? 5 7escribes the dynamic behavior of objects in a system. 5 :our phases. ? nalysis nalysis @ results are objects, dynamic and functional models. (ystem design @ gives a structure of the basic architecture. #bject design @ produces a design document. Implementation @ produces reusable code. 5 Three different parts #bject Model @ presented by object model and the data dictionary. 7ynamic model % presented by the state diagrams and event flow diagrams. ? :unctional Model @ presented by data flow and constraints. +ive detailed notes about the *ooch Methodology? 5 'elps to design your system using the object paradigm. 5 Is critici2ed for his large set of symbols. 5 !onsists of the following diagrams8 !lass diagrams.
#bject diagrams. (tate transition diagrams. Module diagrams. +rocess diagrams. Interaction diagrams. 5 Two processes8 Macro development process Micro development process. 5 Macro development process. +rimary concern @ technical management of the system. (teps involved8 o !onceptuali2ation. o nalysis and development of the model. o 7esign or create the system architecture. o )volution or implementation. o Maintenance. 5 Micro development process. 7escribes the day%to%day activities. (teps involved8 o Identify classes and objects. o Identify classes and object semantics. o Identify classes and object relationships. o Identify classes and object interfaces and implementation. +ive a detailed account of 5acobson methodology? 5 !overs the entire life cycle and stress traceability between the various phases. 5 se cases ? (cenarios for understanding system re*uirements. ? 9on formal te3t with no clear flow of events. ? Te3t Te3t easy to read. ? :ormal style using pseudo code. !an be viewed as concrete or abstract 1not initiated by actors&. 5 #bject oriented software )ngineering8 #bjectory se case model. 7omain #bject Model. nalysis #bject Model. Implementation model. Test model. 5 #bject oriented business )ngineering nalysis phase. 7esign and Implementation phase. ? Testing Testing phase. What is UML? UML is Unified Modeling Language. It is a graphical language for visualizing specifying
constructing and documenting the artifacts of the system. It allows you to create a blue print of all the aspects of the system, before actually physically implementing the system.
What is modeling? What are the advantages of creating a model? Modeling is a proven and well-
accepted engineering technique which helps build a model. Model is a simplification of reality it is a blueprint of the actual system that needs to be built. Model helps to visualize the system. Model helps to specify the structural and behavior of the system. Model helps ma!e templates for constructing the system. Model helps document the system. What are the different views that are considered when building an object-oriented software system? "ormally there are # views. Use $ase view - %his view e&poses the requirements of a system.
'esign (iew - $apturing the vocabulary. )rocess (iew - modeling the distribution of the systems processes and threads. Implementation view - addressing the physical implementation of the system. 'eployment view - focus on the modeling the components required for deploying the system. What are diagrams? 'iagrams are graphical representation of a set of elements most often shown made
of things and associations. associations. What are the major three types of modeling used? Ma*or three types of modeling are structural,
behavioral, and architectural. architectural. Mention the different kinds of modeling diagrams used? Modeling diagrams that are commonly
used are, there are + of them. Use case diagram, $lass 'iagram, b*ect 'iagram, equence 'iagram, statechart 'iagram, $ollaboration 'iagram, ctivity 'iagram, $omponent d iagram, 'eployment 'iagram. What is Architecture? rchitect rchitecture ure is not only ta!ing ta!ing care of the structura structurall and behavioral behavioral aspect of a
software system but also ta!ing into account the software usage, functionality, performance, reuse, economic and technology constraints. What is !L"? 'L$ is oftware 'evelopment Life $ycle. 'L$ of a system included processes that are
Use case driven, rchitecture centric and Iterative and Incremental. %his Life cycle is divided into phases. )hase is a time span between two milestones. %he milestones are Inception, /laboration, $onstruction, and %ransitio %ransition. n. )rocess )rocess 0or!flows 0or!flows that evolve through these phase phase are 1usiness 1usiness Modeling, Modeling, 2equirem 2equirement ent gather gatherin ing, g, naly nalysis sis and and 'esign 'esign,, Implem Implement entati ation, on, %estin %esting, g, 'eploy 'eploymen ment. t. uppor upportin tingg 0or!fl 0or!flows ows are $onfiguration and change management, )ro*ect management. What are #elationships? %here are different !inds of relationships3 'ependencies, 4eneralization, and
ssociation. 'ependencies are relations ships between two entities that that a change in specification of one thing may affect another thing. Most commonly it is used to show that one class uses another class as an argument in the signature of the operation. 4eneralization is relationships specified in the class subclass scenario, it is shown when one entity inherits from other. ssociations are structural relationships that are3 a room has walls, )erson wor!s for a company. ggregation is a type of association where there is a has a relation ship, %hat is a room has walls, 56o if there are two classes room and walls then the relation ship is called a association and further defined as an aggregation. $ow are the diagrams divided? %he nine diagrams are divided into static diagrams and dynamic
diagrams. 7. tatic !iagrams 8lso called tructural 'iagram93 $lass diagram, b*ect diagram, $omponent 'iagram, 'eployment diagram. :. !ynamic !iagrams 8lso called 1ehavioral 'iagrams93 Use $ase 'iagram, equence 'iagram, $ollaboration 'iagram, ctivity diagram, tatechart diagram.
;. What are Messages? message is the specification of a communication, when a message is passed that results in action that is in turn an e&ecutable statement. <. What is an Use "ase? use case specifies specifies the behavior of a system system or a part of a system, system, 5=se cases are used to capture the behavior that need to be developed. It involves the interaction of actors and the system. #. What are Relationships in UML? >. Dependency Dependency is the relationship between two things in which a change in one thing may affect the other thing, but not necessarily the reverse. Graphically, Graphically, it can be represented as a dashed directed line, directed to the thing being depended on. ?. Association An association is a relationship that connects classes. Example of association is relationship between person and company. An association is rendered as solid line. Adornments
of
association
Name: You can use Name to specify the nature of association Role: Each Role: Each class has specific role that participates in the relationship. e can specify role to the classes involve in the relationship. Multiplicity: !t repres represent ents s how many ob"ect ob"ects s may be connec connected ted across across an instan instance ce of an association. Aggregation: !t implies implies whole#par whole#partt relationsh relationship ip where one class class represents represents larger thing which consists of smaller things. Generalization !n this this type type of relati relations onship hip,, the child shares shares the structur structure e and behavior behavior of the parent. parent. !t is represented as a solid line with a hollow arrowhead pointing to the parent.
7eployment diagram Deployment Diagram shows Diagram shows the configuration of run time processing nodes and the components that live on them them.. !t is used used for for mode modeli ling ng topo topolo logy gy of the the hardw hardwar are e on whic which h your your syst system em exec execut utes es.. $ontents Nodes, Dependency.
of
the
diagram
ar e
Define UML? Unified Modeling Language, a standard language for designing and documenting a system in an object-oriented manner. It has nine diagrams which can be used in design document to express design of software architecture.
(I) Can you explain use case diagrams? Use case diagram answers what system does from the user point of view. Use case answer answer !hat !hat will will the system system do"# do"#. Use cases cases are are mainl mainly y used used in re$ re$uir uireme ement nt document to depict clarity regarding a system. %here are three important parts in a use case scenario, actor and use case. Scenario: & scenario is a se$uence of events which happen when a user interacts
with the system.
Actor: &ctor is the who of the system, in other words the end user. Use Case: Use case is tas' or the goal performed by the end user. (elow figure Use
)ase# shows a simple scenario with &ctor# and a Use )ase#. *cenario represents an accountant entering accounts data in the system. &s use case#s represent action performed they are normally represented by strong verbs. &ctor#s are represented by simple stic' man and use case by oval shape as shown in figure Use )ase# below.
igure: Use Case
(I) Can you explain primary and secondary actors? &ctors are further classified in to two types primary and secondary actors. +rimary actors are the users who are the active participants and they initiate the user case, while secondary actors are those who only passively participate in the use case.
(I) !o" does a simple use case loo# li#e? Use case#s have two views of representation in any re$uirement document. ne is the use case diagrams and the other is a detail step table about how the use case wor's. *o it#s li'e a pair first an over view is shown using a use case diagram and then a table explaining the same in detail. (elow is a simple login# use case shown diagra diagramma mmatic ticall ally y and and then then a detail detail table with steps steps about about how the use use case case is executed.
igure: Login Use Case Use Case
el/
Use Case $ame Login Description
%his uses depicts the flow of how user will log-in into the chat application.
%rimary Actor
*imple chat user.
&rigger
User types chat application on UL of the browser. browser.
%re'condition
0&
Assumption
0o password is currently present for the system ooms will remain constant as explained in the assumption section of this document
ailed nd 1uplicate user name is not allowed in the chat application. conditions Action Main Scenario
User clic's on the log-in button. •
•
•
•
User types chat application on UL of the browser which in turn opens the main page. In the main page of application user is popped up with 2nter user name# option and various rooms# option drop down menu. User then types the name and selects one of the room from drop down menu and then clic's on the Log-in# button. &pplication then chec's whether the user name is uni$ue in the system if not then user is popped up with error message that 3user
already exist4. •
&fter entering the uni$ue name the user is finally logged in the application.
Action
0&
Alternate Scenario
0&
Success Scenarios
/. pens page of a selected room in that other user names and their messages can be seen.
$ote and pen 0& Issues &a*le: Login use case ta*le $ote5 6ou must be wondering why we have this pair why not just a use case table
only. Use case diagrams are good to show relationship between use case and they also provide high over view. %he table explanation of a use case tal's details about the use case. *o when a developer or a user is reading a re$uirement document, he can get an overview by loo'ing at the diagram if he is interested he can read the use case tables for more details.
(I) Can you explain +xtend, and +Include, in use cases? 2xtend# and Include# define relationships between use cases. (elow figure 2xtend and Include# shows how these two fundamentals are implemented in a project. %he below use case represents a system which is used to maintain customer. !hen a customer is added successfully it should send an email to the admin saying that a new customer is added. nly admin have rights to modify the customer. 7irst lets define extend and include and then see how the same fits in this use case scenario. Include5 Include relationship represents an invocation of one use case by the other. If you thin' from the coding perspective its li'e one function been called by the other function. 2xtend5 %his relationship signifies that the extending use case will wor' exactly li'e the base use case only that some new steps will inserted in the extended use case. (elow figure 2xtend and Include# shows that add customer# is same as the add discounted customer#. %he &dd discounted customer# has an extra process, to define discount for the discounted customer which is not available for the simple customer. ne of the re$uirements of the project was that when we add a customer, the system should send an email. *o after the customer is added either through &dd