UML interview questions and answers - Freshers & Experienced

What are the different steps involved in object oriented analysis?

The objectives or the steps that are involved in object-oriented analysis and design are:

Create use cases to find the ways that a system can interact with the environment. It also helps to build an overall structure using the objects of the system and allow easy to use model to follow on.

Identify the actors and objects that are involved: identifying the actors and the objects with their attribute and method names makes it easy to structure the system such that a flow gets created which help in designing the overall system.

Establish the relationships between objects: establishing a relationship between different objects allow the design to become more clear and usable.

Establish an interface of each object: allows the object to be seen in a position and the exception handling can also be put up so that if any error occurs it will be known before moving forward.
Implementation and testing of objects takes place to see the proper implementation of the objects and test it to match the environments and needs.Assemble the complete system for use and make it ready to be used by users.

Why analysis is a major part in Object designing?

Analysis allows the decomposition to be done to build the components parts to help in computing the process and specify the system structure. This also allows the proper defining of the functions that are independent to each other. Analysis is done by decomposing the modules or the components. It is usually performed in top-to-bottom fashion using the structured analysis. This method is also called as functional decomposition. This functional decomposition combine with separate data analysis to build a goal that is clear and allow the system to be defined in their own terms. Analysis allows the identification to be performed to find the business process, actors that are involved in the function and the end result that has to be achieved.

Why is it required to have an abstraction layer in UML?

Abstraction allows the identification of key domain objects to match the user requirements. Abstraction keeps all the code at one place allow the physical design to be given at later stage. Abstraction also allows the structure to be maintained as it is and the alternation won't affect the overall system if changes are imposed on the system as whole. It keeps the data of relationship between other objects and their associations with each other. The association has to be maintained such that one's affect won't have any impact on anothe entity that is used in UML. It keeps the data and programs in the same form and keeps their meaning also intact. It hides the implementation details from the users. It reduces the load from the programmer and allow more time to implement the system in complete.

What is the difference between Responsibility-driven and data-driven approaches?

- Data centered approach allow the data to be more stable than functions but this is not the case all the time and there is a possibility of having many structured techniques to handle this approach. Whereas, responsibility driven approach keeps a balance in between both the data and functions and doesn't use many structured techniques.

- Data driven method that represent the traditional entity-relationship modelling, whereas Responsibility-driven approach represent the modern relationship that exists between different entities of the object.

- Data driven method used classes that are represented by static data variables where one class accessed the variable and encapsulated the control rules for the application. Whereas, responsibility driven method divided the behavior between many classes across where it produced more reusable classes that can be represented separately.

What is the difference between translational and elaborational approaches?

- Elaborational approach treat a passage separating their specification from the implementation to create a new initial model and then adding more details to it till the code is not compiled. Whereas, translational approach is the process that defines a sequence of separate models put together that includes a procedure for linking them. It also translates one object from another object.

- Elaborational approach elaborate the object model such that there is no requirement left and all the requirements gets clarified at first go. The elaboration happens in many phases and when the stages are final than the model gets ready. Whereas, the translational approach goes through one state to another state on some action only.

What is the function of attribute facets in UML?

Attribute facets consists of the associations and operations that are defined for other types. It uses two ways first one being the shorthand for the get and set operations and another one is to provide the type of the attribute to use. The attribute facets defines the classes that are tagged with some information and uses {tag=value}. The tags include the following attributes like:

description: defines the descriptive text that is used to define an object.
Keyword: defines the keyword that classifies an object
Abstract classes use the attributes that is used in types not in classes. UML supports the following annotations, facets:
default (or initial) value (name:Type=expression)
visibility prefix (+ = public, – = private, #= protected)

What are the operations on facets supported by UML?

The operations and the methods that are supported for the facets in UML are:
The visiblity operations for public that will be given as + (symbol)
private is given as – (symbol)
protected is given as # (symbol)
It also contains the operations and return type like (name(arg1:Type, ..., argN:Type):Type
It also having Bi-directional associations that will be used instead of encapuslations. The operations that can be performed on the facets include addition, hiding of the attributes to make it public/private/protected so that it will be visible to certain users only and not to anyone else. This is defined by the use of the identifiers mentioned above.

What are the different approaches to store knowledge?

There are three approaches that are used to store the knowledge and they are as follows:

- If the knowledge is separated from the class then there should be system to return back to the previous classes like first class or second class as used in semantic data modeling. This way there can be code re-usability and the information can be coupled together.
- The knowledge can be placed inside any object types, and there we can do preservation of the code. Successful re-usability of the knowledge can be done.
- The knowledge can be stored in both the objects and this will lead to the problem of maintaining two copies of the same thing. This will increase the load and the space and make the data inconsistent to keep.

What are the different types of relationship composition that exists?

There are different types of composition that exists in UML. There are structural relationship also known as configurational relationship as well. The relationship explains that the parts might be of different types or it can be totally detached or invariant. The compositions are all configurational non-homeomeric and non-invariant in nature and as follows:

Component-integral: it consists of all the component level integration classes.
Material: it consists of all the attributes relationship that a class can hold.
Portion: this consists of a particular portion of the class.
Place-area: this consists of the area that is under certain section
Member bunch
Member-partnership It is non-configurable composition relationship

What are various kinds of invariants and rulesets used in UML?

Semantic net and semantic data modeling is used as an invariant to keep all the specifications exhibiting encapsulation of attributes and operations that contain the meaning of the analyst or the user. The semantic content is used in the structures of the association, classification and composition. The usage of it will be done by assertions, invariants and rulesets that describes the behaviour of the class. The use of semantics are limited but they are safer to use. The ruleset has to be checked to see that the operations are done correctly or not. The operations has to be on rule based language and there shouldn't be any distinction of expression. Rules can differ from one class to another class and on some operations.

What are assertion facets used for in UML?

The assertion facets represent the constraint applied on attributes. The range that is defined for the constraints are given in the limits and having some permissible values. The enumeration constraint will also be contained in it and it will also have a list with its own permissible values. There are few type constraints as well that will specify the class of values each belonging to. They are always present and having a generalized values to the classes.

What is the function of operational assertions in UML?

Operational assertions defines in terms of conditions that has to be followed to allow the proper function of the system. The conditions are as follows:

Pre-condition that uses a logical statement which remains true, before the operation can execute.
Post-condition uses a single logical statement, which remains true after its operation has finished execution for a class.
Invariance condition uses a single logical statement that must hold all the operations that are being executed. This will allow the parallel processing system to follow the business process model and then define in terms of guarantee and rely clauses.

What is the difference between rely clause and guarantee?

Rely clause allow the statement to be passed for the pre-condition that remains true till the execution of the operation gets finished and the terms should not be violated. The specification doesn't state the result that can come unexpected as well. In this the server won't be responsible for any condition and it will be managed manually. Whereas, guarantee acts as an statement that a server should keep and maintain it to make it true till the execution of the operation is not finished.
Rely on clause can include more than one assertions of any type and the representation will be done by using the state-transition diagrams. Whereas, guarantee doesn't have to include the assertions.

What is the influence of rule-sets in object assertions?

Class invariant allows a single but quantified logical statement of any subset to be true all the times. Invariants are also called rules and it defines the cardinality constraints on attributes that are given as invariants. Ruleset is an unordered set of class invariants and assertions that brings the attributes together and define the rules for them. The external rulesets in this expresses a second level information whereas, Internal rulesets defines the first level of information with defined sets of invariants. Object assertions are made to include the rulesets that are defined using the logics provided with the objects only.

What are the different types of implementation terms in UML?

There are many implementation terms that need to be known before starting anything on UML are as:

Type: type is a term that defines that a class with no implementation. It is the full assertion that is given to provide the instances and all its rulesets.
Class: is a construct that is used as a blueprint to create instances of the classes.
Interface: it is a list of the messages that is sent to an object with their parameters and return types. This can include get and set operations and their attributes.
Invariant is a type of constraint that consists of a single rule that is followed by all the objects that lies in the scope of its.

What are the rules specified for invariants in first order and second order information?

- The rules are specified for first order and second order information and it is provided for the first order as that internal attribute values are not stored explicitly and there is always a database trigger that will represent the objects.
- The operations has to be in non-procedural language and it will represent the objects and the control will be done from here only.
- The second order rules specifies the dependencies that exist between attributes .
- Global pre-conditions and post-conditions will be applied to all the operations.
- Rules will help the invariants to make an object’s semantics explicit and make it visible for all the object. This helps in describing the information in the repository and allow the business rules to be implemented properly.

How does the rule chaining concept works in UML?

Rule chaining is based on some rules based system that is non-procedural and the ordering of the rules doesn't affect the interpretation of it. Rules are grouped together into rulesets with the derivation of all the values of some objects. It includes the rule of another object and allow the developers to also include their own rules to identify the objects uniquely. The following example will show the following work flow:
Regime = ‘Backward’;
Goal = product;
If client.status is ‘Retired’
then product is ‘Annuity’;

If client.status is ‘Young’
and client.preference is not ‘Risk’
then product: is ‘Endowment’;

If Client.Children: > 0
then client.preference is ‘Risk’;

What does state model represent?

State model defines the state transition diagrams that are useful to create UML state charts. These diagrams are used to capture the dynamic nature of each object that are related in the object model. It defines the effective specification of operations and assertions. This represents the possible sequence of state change from one state to another. The transition is the change in state from one to another. This can have very complex design and it represent the state of the object from start till end. It captures the information about the business and the system on which it is implemented. The use case model is used to define the state model in which there is always a start state and an end state. The transactions are represented by the communication that is happening in between.

What are the roles played by packages, modules and wrappers in UML?

- Packages are used to organize the classes at one place. It uses modelling to describe the system with less complexity and provide many strategies to incorporate in the model. The unit of package as the classes in the same package are closely related. These keeps all the classes together that are related to each other and uses the association and different use cases to create models.

- Modules are also known as component diagrams that includes nodes as physical computers and displays several packages inside a component. Modules are used to hold the packages together in one and can be used together.

- Wrappers are used to constitute a package that consists of contents of the package. It deploys client-server or architectural layers that are connected using the API that are predefined. Wrappers use the components that consists of object and allow fall back on standard UML model.

What are the different steps involved in object oriented analysis?

The objectives or the steps that are involved in object-oriented analysis and design are:

- Create use cases to find the ways that a system can interact with the environment. It also helps to build an overall structure using the objects of the system and allow easy to use model to follow on.
- Identify the actors and objects that are involved: identifying the actors and the objects with their attribute and method names makes it easy to structure the system such that a flow gets created which help in designing the overall system.
- Establish the relationships between objects: establishing a relationship between different objects allow the design to become more clear and usable.
- Establish an interface of each object: allows the object to be seen in a position and the exception handling can also be put up so that if any error occurs it will be known before moving forward.
- Implementation and testing of objects takes place to see the proper implementation of the objects and test it to match the environments and needs.
- Assemble the complete system for use and make it ready to be used by users.

Why analysis is a major part in Object designing?

Analysis allows the decomposition to be done to build the components parts to help in computing the process and specify the system structure. This also allows the proper defining of the functions that are independent to each other. Analysis is done by decomposing the modules or the components. It is usually performed in top-to-bottom fashion using the structured analysis. This method is also called as functional decomposition. This functional decomposition combine with separate data analysis to build a goal that is clear and allow the system to be defined in their own terms. Analysis allows the identification to be performed to find the business process, actors that are involved in the function and the end result that has to be achieved.

Why is it required to have an abstraction layer in UML?

Abstraction allows the identification of key domain objects to match the user requirements. Abstraction keeps all the code at one place allow the physical design to be given at later stage. Abstraction also allows the structure to be maintained as it is and the alternation won't affect the overall system if changes are imposed on the system as whole. It keeps the data of relationship between other objects and their associations with each other. The association has to be maintained such that one's affect won't have any impact on anothe entity that is used in UML. It keeps the data and programs in the same form and keeps their meaning also intact. It hides the implementation details from the users. It reduces the load from the programmer and allow more time to implement the system in complete.

What is the difference between Responsibility-driven and data-driven approaches?

- Data centered approach allow the data to be more stable than functions but this is not the case all the time and there is a possibility of having many structured techniques to handle this approach. Whereas, responsibility driven approach keeps a balance in between both the data and functions and doesn't use many structured techniques.
- Data driven method that represent the traditional entity-relationship modelling, whereas Responsibility-driven approach represent the modern relationship that exists between different entities of the object.
- Data driven method used classes that are represented by static data variables where one class accessed the varibable and encapsulated the control rules for the application. Whereas, responsibility driven method divided the behavior between many classes across where it produced more reusable classes that can be represented separately.

What is the difference between translational and elaborational approaches?

Elaborational approach treat a passage separating their specification from the implementation to create a new initial model and then adding more details to it till the code is not compiled. Whereas, translational approach is the process that defines a sequence of separate models put together that includes a procedure for linking them. It also translates one object from another object.
Elaborational approach ellaborate the object model such that there is no requirement left and all the requirements gets clarified at first go. The ellaboration happens in many phases and when the stages are final than the model gets ready. Whereas, the translational approach goes through one state to another state on some action only.

What is the function of attribute facets in UML?

Attribute facets consists of the associations and operations that are defined for other types. It uses two ways first one being the shorthand for the get and set operations and another one is to provide the type of the attribute to use. The attribute facets defines the classes that are tagged with some information and uses {tag=value}. The tags include the following attributes like:
description: defines the descriptive text that is used to define an object.
Keyword: defines the keyword that classifies an object
Abstract classes use the attributes that is used in types not in classes. UML supports the following annotations, facets:
default (or initial) value (name:Type=expression)
visibility prefix (+ = public, – = private, # = protected)

Why are attributes used in UML?

Attributes are declared as a state variable that represents the total number of states that an object may occupy. The types of association are classified as {set}, {bag}, {ordered set} or
{list}. The attributes can have many types like:

variable: the value changes according the requirement. Different instances can have different values.
fixed: the value doesn't change during the lifetime of the object.
Common: it requires the instances to have same value without knowing the value of it
unique: Each instance will have a unique values as these uniquely identify the processes that are running and each will have a different storage point.

What are the operations on facets supported by UML?

The operations and the methods that are supported for the facets in UML are:
The visiblity operations for public that will be given as + (symbol)
private is given as – (symbol)
protected is given as # (symbol)
It also contains the operations and return type like (name(arg1:Type, ..., argN:Type):Type
It also having Bi-directional associations that will be used instead of encapuslations. The operations that can be performed on the facets include addition, hiding of the attributes to make it public/private/protected so that it will be visible to certain users only and not to anyone else. This is defined by the use of the identifiers mentioned above.

What are the different approaches to store knowledge?

There are three approaches that are used to store the knowledge and they are as follows:
If the knowledge is separated from the class then there should be system to return back to the previous classes like first class or second class as used in semantic data modeling. This way there can be code re-usability and the information can be coupled together.
The knowledge can be placed inside any object types, and there we can do preservation of the code. Successful re-usability of the knowledge can be done.
The knowledge can be stored in both the objects and this will lead to the problem of maintaining two copies of the same thing. This will increase the load and the space and make the data inconsistent to keep.

What are the different types of relationship composition that exists?

There are different types of composition that exists in UML. There are structural relationship also known as configurational relationship as well. The relationship explains that the parts might be of different types or it can be totally detached or invariant. The compositions are all configurational non-homeomeric and non-invariant in nature and as follows:
Component-integral: it consists of all the component level integration classes.
Material: it consists of all the attributes relationship that a class can hold.
Portion: this consists of a particular portion of the class.
Place-area: this consists of the area that is under certain section
Member bunch
Member-partnership It is non-configurable composition relationship

What are various kinds of invariants and rulesets used in UML?

Semantic net and semantic data modeling is used as an invariant to keep all the specifications exhibiting encapsulation of attributes and operations that contain the meaning of the analyst or the user.
The semantic content is used in the structures of the association, classification and composition. The usage of it will be done by assertions, invariants and rulesets that describes the behaviour of the class. The use of semantics are limited but they are safer to use. The ruleset has to be checked to see that the operations are done correctly or not. The operations has to be on rule based language and there shouldn't be any distinction of expression. Rules can differ from one class to another class and on some operations.

What are assertion facets used for in UML?

The assertion facets represent the constraint applied on attributes. The range that is defined for the constraints are given in the limits and having some permissible values. The enumeration constraint will also be contained in it and it will also have a list with its own permissible values. There are few type constraints as well that will specify the class of values each belonging to. They are always present and having a generalized values to the classes.

What is the difference between rely clause and guarantee?

Rely clause allow the statement to be passed for the pre-condition that remains true till the execution of the operation gets finished and the terms should not be violated. The specification doesn't state the result that can come unexpected as well. In this the server won't be responsible for any condition and it will be managed manually. Whereas, guarantee acts as an statement that a server should keep and maintain it to make it true till the execution of the operation is not finished.
Rely on clause can include more than one assertions of any type and the representation will be done by using the state-transition diagrams. Whereas, guarantee doesn't have to include the assertions.

What is the influence of rule-sets in object assertions?

Class invariant allows a single but quantified logical statement of any subset to be true all the times. Invariants are also called rules and it defines the cardinality constraints on attributes that are given as invariants. Ruleset is an unordered set of class invariants and assertions that brings the attributes together and define the rules for them. The external rulesets in this expresses a second level information whereas, Internal rulesets defines the first level of information with defined sets of invariants. Object assertions are made to include the rulesets that are defined using the logics provided with the objects only.

What are the different types of implementation terms in UML?

There are many implementation terms that need to be known before starting anything on UML are as:
Type: type is a term that defines that a class with no implementation. It is the full assertion that is given to provide the instances and all its rulesets.
Class: is a construct that is used as a blueprint to create instances of the classes.
Interface: it is a list of the messages that is sent to an object with their parameters and return types. This can include get and set operations and their attributes.
Invariant is a type of constraint that consists of a single rule that is followed by all the objects that lies in the scope of its.
UML - What is UML?
UML - UML is Unified Modeling Language, graphical language for visualizing artifacts of the system......
UML modeling - Define modeling in UML and it advantages.
UML modeling - Model is a simplification of reality, it is Blueprint of the actual system.....
UML views - What are the different views in UML?
UML views -Use Case view, Design View, Process View, Implementation view, Deployment view
Post your comment
Discussion Board
UML interview questions and answers
What is the difference between uses and extends?
The difference between uses and extends is that:
- Uses, use one’s functionality to complete the task whereas, extends, provide extended functionality or properties to a task to make it to run to completion.
- “A uses B” represent that task “A” has a subtask “B”. This tells that for A to go towards completion first the task Y has to be completed.
- “A extends B” represent that task “A” is a specific case of “B”. It tells that “A” has added functionality to make the process “B” runs to completion.

How do we represent private, public and protected in class diagrams?
Private, public and protected are the visibility properties in class diagrams that control the visibility options for a particular diagram. A symbol has to be represented with each property and method. (+) represent that it is a public property/method, which can be accessed from anywhere. (-) represent private property/method that can only be accessed within a component. (#) represent protected property/method that can only be seen within a component, not outside it.

What does associations, aggregation and composition in a class diagram mean?
- Association is a way of representing and grouping the classes to create a module. As, one class can’t represent the whole module in a project. To represent the whole module as one, you need to group them and have relationships between them.
- Aggregation and composition is part of association. Aggregation allows the object to exist without an aggregated object. For example, two classes given university and department, in this the university can’t exist without department so there is dependency of each other.
- Composition represents whole-part relationship; data in this usually flows in only one direction. For example: if the professor leaves the department still the department continues.

How the object diagrams gets represented in UML?
Object diagrams give a pictorial representation of class diagram. Object diagrams are represented with objects only and the relationships gets defined between them. The properties which it will contain are the Object Name: Class Name, Property Name, relationship type, actors etc. This is a way to represent overall information in a tidy manner.
Rohit Sharma 12-16-2011
UML interview questions and answers
What is a UML Use Case Diagram (UCD), and when should you use it?
UML use case diagram is used to represent the entire functionality of the system. It uses actors, arrows and use cases to represent the system. They are very different from sequence diagrams or flow charts. They have 3 major elements through which they represent the entire system and these are as follows:
- Actors: outside/inside entities that interacts with the system
- Use cases: services which is used to let the system knows how to perform
- Lines or arrows: representing relationship between the actor and use cases
You should use the Use Case Diagram to represent the functionality of your system, where the details are of very high level.

How to identify the actors in a UCD?
To identify the actors in Use Case Diagram first of all, you have to identify the actions that has to be taken by the actors. Choose the actors such that the behavior of it doesn’t change. Actors in most of the cases will be in human form as you will be interacting with the system. If the system of yours will be interacting with other systems then make actors that are good to be used in there. Example: Interaction with the database system- interactions with the inventory management system has to be formulated and the actors to be decided just for interaction purpose with this existing system.

How a UML Use Case is Diagram different from a traditional flow chart?
- Use Case Diagram is represented in a top-down manner whereas, flow chart is represented in a time based way.
- Use Case Diagram shows the functionality in diagrammatic way whereas; flow chart shows the functionality in a linear fashion.
- Use Case Diagram describes the system all together at once whereas; flow chart doesn’t describe the system until you have all the points from the start.
- Use Case Diagram support the process of analysis and design much better than flow charts.
Rohit Sharma 12-16-2011
UML interview questions and answers
Who maintains the UML specification and how is it updated?
The group that maintains the UML specification is termed as Object Management Group (OMG). The revisions take place according to the suggestions being passed from all around. Revision task force (RTF) is responsible to do all the minor revision to take effect on the UML specifications. Whereas, Requests for Proposal (RFP) group is taking care of all the major revisions

Why can't I easily interchange UML models between modeling tools?
You can’t easily interchange UML models between modeling tools, it is due to two technical reasons: XML tries to solve problems, that are difficult than exchanging UML models. it usually provides a mechanism to facilitate the exchange of any language into any other, which is being defined by OMG’s Metamodel object facility (MOF). 2nd reason is very specific that, it lacks information to have a reliable communication between its modeling tools.

On what basis I will select or choose an UML modeling tool?
You should have your own requirement for the modeling tool, to determine the type of support you require. There are few things, which has to be considered for choosing the UML modeling tool and it is as follows:
- Tool that includes the support for compliance with UML specification
- Tool that provides support for both notation and semantics of UML
- Tool that includes model simulation and code-generation
- Tool that includes model interchange with other UML tools
- Tool that includes tool customization properties
Rohit Sharma 12-16-2011