Explain about Multiplicity Property of Associations in UML Class Diagrams? | UML Programmer Guide | UML Interview Question

Multiplicity Property of Associations deals with the relationship between objects. Given below are the possible combination of values for multiplicity property of associations in UML
  • 1 - this end of the association always links to one object. In the figure, every Menu Item has one Menu.
  • 0..1 - either this end of the association links to one object, or there is no link.
  • * - every object at the other end of the association is linked to a collection of objects at this end, and the collection may be empty.
  • 1..* - every object at the other end of the association is linked to at least one object at this end. In the figure, every Menu has at least one Menu Item.
  • n .. m - each object at the other end has a collection of between n and m links to objects at this end.

Brief about OO Analysis and Design? | UML Interview Question | UML Tutorial

Object Oriented analysis can be defined as investigation and to be more specific it is the investigation of objects. Design means collaboration of identified objects.

So it is important to understand the OO analysis and design concepts. Now the most important purpose of OO analysis is to identify objects of a system to be designed. This analysis is also done for an existing system. Now an efficient analysis is only possible when we are able to start thinking in a way where objects can be identified. After identifying the objects their relationships are identified and finally the design is produced.

So the purpose of OO analysis and design can described as:
  • Identifying the objects of a system.
  • Identify their relationships.
  • Make a design which can be converted to executables using OO languages.
There are three basic steps where the OO concepts are applied and implemented. The steps can be defined as
OO Analysis --> OO Design --> OO implementation using OO languages

Now the above three points can be described in details:
  • During object oriented analysis the most important purpose is to identify objects and describing them in a proper way. If these objects are identified efficiently then the next job of design is easy. The objects should be identified with responsibilities. Responsibilities are the functions performed by the object. Each and every object has some type of responsibilities to be performed. When these responsibilities are collaborated the purpose of the system is fulfilled.
  • The second phase is object oriented design. During this phase emphasis is given upon the requirements and their fulfilment. In this stage the objects are collaborated according to their intended association. After the association is complete the design is also complete.
  • The third phase is object oriented implementation. In this phase the design is implemented using object oriented languages like Java, C++ etc.

Object Oriented Concepts in UML | UML Tutorial | UML Programmer Guide

UML can be described as the successor of object oriented analysis and design.
An object contains both data and methods that control the data. The data represents the state of the object. A class describes an object and they also form hierarchy to model real world system. The hierarchy is represented as inheritance and the classes can also be associated in different manners as per the requirement.

The objects are the real world entities that exist around us and the basic concepts like abstraction, encapsulation, inheritance, polymorphism all can be represented using UML.

So UML is powerful enough to represent all the concepts exists in object oriented analysis and design. UML diagrams are representation of object oriented concepts only. So before learning UML, it becomes important to understand OO concepts in details.

Following are some fundamental concepts of object oriented world:
  • Objects: Objects represent an entity and the basic building block.
  • Class: Class is the blue print of an object.
  • Abstraction: Abstraction represents the behavior of an real world entity.
  • Encapsulation: Encapsulation is the mechanism of binding the data together and hiding them from outside world.
  • Inheritance: Inheritance is the mechanism of making new classes from existing one.
  • Polymorphism: It defines the mechanism to exists in different forms.

Brief about UML Activity Diagram? | UML Interview Question

Activity diagram is another important diagram to describe dynamic behavior. Activity diagram consists of activities, links, relationships etc. It models all types of flows like parallel, single, concurrent etc.

Activity diagram describes the flow control from one activity to another without any messages. These diagrams are used to model high level view of business requirements.

Brief about UML Statechart Diagram? | UML Interview Question

Statechart diagrams are one of the five diagrams used for modeling dynamic nature of a system. These diagrams are used to model the entire life cycle of an object. Activity diagram is a special kind of Statechart diagram.

State of an object is defined as the condition where an object resides for a particular time and the object again moves to other states when some events occur. Statechart diagrams are also used for forward and reverse engineering.

Brief about UML Interaction Diagram? | UML Interview Question

Interaction diagrams are used for capturing dynamic nature of a system. Sequence and collaboration diagrams are the interaction diagrams used for this purpose.

Sequence diagrams are used to capture time ordering of message flow and collaboration diagrams are used to understand the structural organization of the system. Generally a set of sequence and collaboration diagrams are used to model an entire system.

Brief about UML Use Case Diagram? | UML Interview Question

Use case diagram is used to capture the dynamic nature of a system. It consists of use cases, actors and their relationships. Use case diagram is used at a high level design to capture the requirements of a system.

So it represents the system functionalities and their flow. Although the use case diagrams are not a good candidate for forward and reverse engineering but still they are used in a slightly differently way to model it.

Brief about UML Deployment Diagram? | UML Interview Question

Component diagrams are used to describe the static deployment view of a system. These diagrams are mainly used by system engineers.

Deployment diagrams are consists of nodes and their relationships. An efficient deployment diagram is an integral part of software application development.

Brief about UML Component Diagram? | UML Interview Question

Component diagrams are special kind of UML diagram to describe static implementation view of a system. Component diagrams consist of physical components like libraries, files, folders etc.

This diagram is used from implementation perspective. More than one component diagrams are used to represent the entire system. Forward and reverse engineering techniques are used to make executables from component diagrams.

Brief about UML Object Diagram? | UML Interview Question

An object diagram is an instance of a class diagram. So the basic elements are similar to a class diagram. Object diagrams are consists of objects and links. It captures the instance of the system at a particular moment.

Object diagrams are used for prototyping, reverse engineering and modeling practical scenarios.

Purpose of UML? | Why we need Unified Modeling Language? | UML Interview Question

UML is a general purpose modeling language. It was initially started to capture the behavior of complex software and non software system and now it has become an OMG standard.

UML provides elements and components to support the requirement of complex systems. UML follows the object oriented concepts and methodology. So object oriented systems are generally modeled using the pictorial language.

UML diagrams are drawn from different perspectives like design, implementation, deployment etc.

At the conclusion UML can be defined as a modeling language to capture the architectural, behavioral and structural aspects of a system.

Objects are the key to this object oriented world. The basic requirement of object oriented analysis and design is to identify the object efficiently. After that the responsibilities are assigned to the objects. Once this task is complete the design is done using the input from analysis.

The UML has an important role in this OO analysis and design, The UML diagrams are used to model the design. So the UML has an important role to play.

Brief About Different Types of UML Diagrams? | UML Interview Questions

UML diagrams are broadly categorized as structural and behavioral diagrams.

  • Structural diagrams are consists of static diagrams like class diagram, object diagram etc.
  • Behavioral diagrams are consists of dynamic diagrams like sequence diagram, collaboration diagram etc.

The static and dynamic nature of a system is visualized by using these diagrams.

Brief About Class Diagram in UML? | UML Interview Question | Architect Interview Question

Class diagrams are the most popular UML diagrams used by the object oriented community. It describes the objects in a system and their relationships. Class diagram consists of attributes and functions.

A single class diagram describes a specific aspect of the system and the collection of class diagrams represents the whole system. Basically the class diagram represents the static view of a system.

Class diagrams are the only UML diagrams which can be mapped directly with object oriented languages. So it is widely used by the developer community.

Types Of Diagrams in UML | Diagrams In Unified Modeling Language | Unified Modeling Language Quick Reference Guide | UML Tutorial

The Unified Modeling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software-intensive system.UML provides blue prints for business process, System function, programming language statements, database schemas and reusable components.

There are nine types of diagrams in UML:

Use case diagram

They describe "WHAT" of a system rather than "HOW" the system does it. They are used to identify the primary elements and processes that form the system. The primary elements are termed as "actors" and the processes are called "use cases". Use Case
diagrams shows "actors" and there "roles".

Class diagram:

From the use case diagram, we can now go to detail design of system, for which the primary step is class diagram. The best way to identify classes is to consider all "NOUNS" in use cases as classes, "VERBS" as methods of classes, relation between actors can then be used to define relation between classes. The relationship or association between the classes can be either an "is-a" or "has-a" relationship which can easily be identified from use cases.

Object diagram:

An object is an instance of a class. Object diagram captures the state of classes in the system and their relationships or associations at a specific point of time.

State diagram:

A state diagram, as the name suggests, represents the different states that objects in the system undergo during their life cycle. Object change in response to certain simulation so this simulation effect is captured in state diagram. Therefore, it has a initial state and final state and events that happen in between them. Whenever you think that some simulations are complicated, you can go for this diagram.

Sequence diagram:

Sequence diagrams can be used to explore the logic of a complex operation, function, or procedure. They are called sequence diagrams because sequential nature is shown via ordering of messages. First message starts at the top and the last message ends at bottom. The important aspect of a sequence diagram is that it is time-ordered. This means that the exact sequence of the interactions between the objects is represented step by step. Different objects in the sequence diagram interact with each other by passing "messages".

Collaboration diagram:

A collaboration diagram groups together the interactions between different objects to fulfill a common purpose.

Activity diagram:

Activity diagram is typically used for business process modeling, for modeling the logic captured by a single use case, or for visualizing the detailed logic of a business rule. Complicated process flows in the system are captured in the activity diagram. Similar to a state diagram, an activity diagram also consists of activities, actions, transitions, initial and final states, and guard conditions. However, difference is state diagrams are in context of simulation while activity gives detail view of business logic.

Deployment diagram:

Deployment diagrams show the hardware for your system, the software that is installed on that hardware, and the middleware used to connect the disparate machines to one another. It shows how the hardware and software work together to run a system. In one, line its shows the deployment view of the system.

Component diagram:

The component diagram represents the high-level parts that make up the system. From .NET angle point of view, they form the "NAMESPACES". This diagram depicts, at a high level, what components form part of the system, and how they are interrelated. Its shows the logical grouping of classes or group of other components.