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.
1 2 3 4

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