Wednesday 4 September 2013

UML Use Case Diagram

Overview:

To model a system the most important aspect is to capture the dynamic behaviour. To clarify a bit in details, dynamic behaviour means the behaviour of the system when it is running /operating.
So only static behaviour is not sufficient to model a system rather dynamic behaviour is more important than static behaviour. In UML there are five diagrams available to model dynamic nature and use case diagram is one of them. Now as we have to discuss that the use case diagram is dynamic in nature there should be some internal or external factors for making the interaction.
These internal and external agents are known as actors. So use case diagrams are consists of actors, use cases and their relationships. The diagram is used to model the system/subsystem of an application. A single use case diagram captures a particular functionality of a system.
So to model the entire system numbers of use case diagrams are used.

Purpose:

The purpose of use case diagram is to capture the dynamic aspect of a system. But this definition is too generic to describe the purpose.
Because other four diagrams (activity, sequence, collaboration and Statechart) are also having the same purpose. So we will look into some specific purpose which will distinguish it from other four diagrams.
Use case diagrams are used to gather the requirements of a system including internal and external influences. These requirements are mostly design requirements. So when a system is analyzed to gather its functionalities use cases are prepared and actors are identified.
Now when the initial task is complete use case diagrams are modelled to present the outside view.
So in brief, the purposes of use case diagrams can be as follows:
  • Used to gather requirements of a system.
  • Used to get an outside view of a system.
  • Identify external and internal factors influencing the system.
  • Show the interacting among the requirements are actors.

How to draw Use Case Diagram?

Use case diagrams are considered for high level requirement analysis of a system. So when the requirements of a system are analyzed the functionalities are captured in use cases.
So we can say that uses cases are nothing but the system functionalities written in an organized manner. Now the second things which are relevant to the use cases are the actors. Actors can be defined as something that interacts with the system.
The actors can be human user, some internal applications or may be some external applications. So in a brief when we are planning to draw an use case diagram we should have the following items identified.
  • Functionalities to be represented as an use case
  • Actors
  • Relationships among the use cases and actors.
Use case diagrams are drawn to capture the functional requirements of a system. So after identifying the above items we have to follow the following guidelines to draw an efficient use case diagram.
  • The name of a use case is very important. So the name should be chosen in such a way so that it can identify the functionalities performed.
  • Give a suitable name for actors.
  • Show relationships and dependencies clearly in the diagram.
  • Do not try to include all types of relationships. Because the main purpose of the diagram is to identify requirements.
  • Use note when ever required to clarify some important points.
The following is a sample use case diagram representing the order management system. So if we look into the diagram then we will find three use cases (Order, SpecialOrder and NormalOrder) and one actor which is customer.
The SpecialOrder and NormalOrder use cases are extended from Order use case. So they have extends relationship. Another important point is to identify the system boundary which is shown in the picture. The actor Customer lies outside the system as it is an external user of the system.
UML Use Case Diagram

Where to Use Case Diagrams?

As we have already discussed there are five diagrams in UML to model dynamic view of a system. Now each and every model has some specific purpose to use. Actually these specific purposes are different angles of a running system.
So to understand the dynamics of a system we need to use different types of diagrams. Use case diagram is one of them and its specific purpose is to gather system requirements and actors.
Use case diagrams specify the events of a system and their flows. But use case diagram never describes how they are implemented. Use case diagram can be imagined as a black box where only the input, output and the function of the black box is known.
These diagrams are used at a very high level of design. Then this high level design is refined again and again to get a complete and practical picture of the system. A well structured use case also describes the pre condition, post condition, exceptions. And these extra elements are used to make test cases when performing the testing.
Although the use cases are not a good candidate for forward and reverse engineering but still they are used in a slight different way to make forward and reverse engineering. And the same is true for reverse engineering. Still use case diagram is used differently to make it a candidate for reverse engineering.
In forward engineering use case diagrams are used to make test cases and in reverse engineering use cases are used to prepare the requirement details from the existing application.
So the following are the places where use case diagrams are used:
  • Requirement analysis and high level design.
  • Model the context of a system.
  • Reverse engineering.
  • Forward engineering.

Reserve Bank of India decreases dollar limit for students going abroad

With rupee's rapid depreciation, coupled with RBI bringing down the amount of dollars one can take out of the country, students may have to trim expenses and redraw their strategy. This article offers quick solutions to tide over the crisis.

Students aiming for higher education in foreign universities are a bit nervous about their future.

A rapidly depreciating rupee was the first blow. The second one was from the Reserve Bank of India (RBI) a few days ago. In its bid to arrest the free-falling rupee, the banking regulator has brought down the amount of dollar one can take out of the country from $2,00,000 to $75,000 in a financial year. "Education loans and remittances related to overseas studies are a part of the $75,000 limit, but if someone wants to remit a higher amount, they can do so with prior permission of the central bank," says the RBI spokesperson.

That statement sure offers a ray of hope for those who have the wherewithal, but for others the only way out is to prune expenses and redraw the strategy to fund education.



"Almost 60-70% of students who go abroad will not find it difficult to adhere to this limit. However, in case of several programmes, particularly the MBA courses, the course fee itself will exceed the $75,000 limit," says Naveen Chopra, founder and chairman of the Delhi-based overseas education consultancy firm The Chopras. That means the RBI move could have an impact on some management programmes immediately.

"The comfort level has already shrunk. Students who have enrolled in high-end universities or have taken up courses with huge course fee, will have a tough time," adds Chopra.

Cutting corners

Most Indian students are known to lead an almost nerdy life in foreign universities. This habit, if inculcated, will sure help the future candidates. "Indian students are usually quite thrifty while studying abroad. In the US, for a post-graduation course, the annual fee is typically in the range of $25,000-40,000, on an average. Living expenses could be around $15,000 a year, depending on the lifestyle," says Swati Salunkhe, managing director with career counselling firm The Growth Centre.

If your total expenses — including course fee and living expenses — in a financial year exceed $75,000, you will have to make some adjustments to your plan. That includes compromising on the university or institution you have always aspired for. "You can look for cheaper educational destinations. For instance, Australia, Germany, Singapore, and Canada are some of the countries that one can consider to pursue studies. The reasons are varied like low tuition fees or low living expenses and even work permits, which make these countries appealing," says Salunkhe.

You should also look for options to secure scholarships and tuition waivers. Similarly, you can also try to get subject credits by shortening the duration of the course. "Students studying abroad can get the benefit of completing the course in lesser duration by taking up the subject credits during the vacation period given by the university. Most international students do not take break during the course of study and complete the required credits faster as it helps them reduce the course duration and also save on the travel costs. This is possible as the universities abroad provide flexibility for students," adds Salunkhe.

Funding options

Obviously, obtaining a scholarship is the best way to fund your studies and overcoming the problems of restrictions on taking dollars out of the country. Another option is to take up part-time jobs. "They do, and need to, look for these jobs, irrespective of any constraint of bringing in dollars from India. Such income will help them fund their regular, day-to-day expenses," says Chopra. Therefore, identifying the right assignment should be your first priority as soon as you are reasonably settled. "International students who are studying full-time courses in universities abroad are allowed to work part-time, generally 20 hours in a week, in most of the countries. These part-time jobs are generally on-campus and off-campus.



Students have to complete the required formalities to work offcampus," says Salunkhe. Off-campus jobs could include odd jobs in malls, restaurants, gas stations and shops. "US universities have more options of teaching assistantship. This is provided to students pursuing their master's courses. They get a stipend amount for the same. Students who are pursuing researchbased courses have the option of getting research assistantships. Working in libraries, university stores, canteens are considered as on-campus part-time opportunities for students," she adds.

Source : ET

Survey :-Job cuts on anvil at India Inc, salary hikes to hit dead-end

Amid continuing economic uncertainties, a lesser number of companies at plan to create new jobs in the coming months, while some employers also expect job cuts, says a survey by job portal Naukri.com.

Just about 54 per cent of India Inc predict fresh job creation in the second half of this year whereas the same sentiment was shared by 68 per cent entities at the start of 2013, while salary hikes too are expected to be on the lower side, said the survey.

Hiring sentiment would be muted for the remaining half of 2013 amid economic uncertainties, it added.

While around 53 per cent recruiters expect replacement hiring in the second half of this year, about "15 per cent of recruiters have anticipated a hiring freeze and layoffs in the coming months".

Layoffs are expected to increase in banking, auto and ITES sectors, the survey said.

The survey covered more than 1,100 employers.

Info Edge India's Chief Financial Officer Ambarish Raghuvanshi said macroeconomic indicators are running weak, the rupee has stumbled to an all time low and inflationary pressures are strong.

"The hiring confidence can't overlook these parameters and hence reflects the slowdown. However, replacement hiring would be considerable in the coming six months," he added.

Naukri.com is part of Info Edge group.

Going by the survey, most sectors -- except for IT and construction -- witnessed a sharp decline in creation of new jobs last month as compared to January.

"About 15 per cent of recruiters have anticipated a hiring freeze and layoffs in the coming months as compared to 10 per cent in January 2013," it said.
Regarding increments for employees this year, the survey found that 39 per cent recruiters expect the increment to be in the range of "10 to 15 per cent".

About 33 per cent respondents said that increments are expected to be less than 10 per cent.

"Lowest increments were given in the auto and pharma sector, wherein a majority of the recruiters said salary hikes in their organisation were in the range of 5-10 per cent in 2013," it said.

On the other hand, 45 per cent respondents said attrition level has been stable over last 12 months.

However, striking an optimistic note, Raghuvanshi said, going forward, improvement in the economy would be factored in gradually by employers.

The Naukri Hiring Outlook Survey is conducted twice a year.

Source : Financial Express.

 Sources:- Infosys planning to cut onsite jobs

In an attempt to ensure cost efficiency in its operations, Infosys -- India's second-largest IT services exporter -- is likely to reduce its onsite operations, reported ET Now. 

According to ET Now sources, Infosys is considering downsizing its onsite, which implies that a lot of people in the support functions are likely to face the possibility of a job cut. 

ET Now understands that the marketing team in the US is also on the radar. "Also, the Infosys management is looking to cut costs in the strategic global sourcing (SGS) division," ET Now reported. 

This is being seen as an attempt to restructure the sales engine in the US. "Infosys feels that the SGS group is overlapping with what the sales function does," ET Now added. 

It is believed that NR Narayana Murthy and his son Rohan Murty have been in the US for the last two weeks to fine tune the strategy to cut costs on onsite. Infosys' onsite cost accounts for 46% of total cost as of March 2013. The management refused to comment on any queries pertaining to 'internal organizational matters.' 

ET had earlier reported that Infosys under Chairman Murthy is centralising decision making. The chairman's office — the new power centre created after the return of retired co-founder Murthy — has to sign off on key decisions related to large technology contracts, such as pricing or the way a deal is structured that might expose Infosys to future risks, at least three senior executives told ET on the condition of anonymity. 

"For all practical purposes, Murthy is the chairman, CEO, COO all rolled into one," said one of the executives. 

Before Murthy's return, chief executive officer SD Shibulal was in the process of decentralizing decision-making, especially those related to negotiating and signing contracts. 

The intention was to empower client-facing sales executives who are aware of moves by competitors and other considerations critical in negotiating and winning large outsourcing contracts. Under that model, a business unit head would be empowered to close large deals. 

For Infosys, which gets the lion's share of its over $7-billion (Rs 42,000 crore) revenues from corporations in the US and Europe, this could mean longer decision cycles when it comes to large contract negotiations

Source : TOI

: Report :- Slowdown hits online hiring activity

Online hiring activity registered a decline of nearly 4% in July over the same month a year ago amid weak economic conditions, according to a research by job portal Monster.com. 

On a month-to-month basis, the index witnessed even a sharper decline as it was down by 6.10% to 123 in July from 131 it registered in June. 

"The decline in annual growth is reflective of the prevailing challenging economic conditions. Keeping in mind the uncertain economic/ political scenario, companies are adopting a cautious approach while hiring which is reflected in the index," Monster.com (India/ Middle-East/South-East Asia) Managing Director Sanjay Modi said. 

A sectoral analysis shows that 12 of the 27 industry sectors monitored by the Monster Employment Index registered expansion in online recruitment activity between July 2012 and July 2013. 

While hiring in telecom/ISP sector improved by 20% followed by BPO/ITeS sector (up 18%), chemicals/ plastic/ rubber, paints, fertiliser/ pesticides (down 13%) showed steepest annual decline. 

Online demand improved in six of 13 occupational groups monitored by the Monster Employment Index between July 2012 and July 2013. 

The most substantial annual gains amongst occupational groups was registered in customer service (up 18 per cent) followed by hospitality and travel (up 10%). 

Among occupation groups, senior management exhibited the steepest annual decline (down 56%).

Online recruitment activity was up on the year in six of 13 locations monitored by the index. 

Kolkata (up 21%) followed by Chandigarh (up 15%) led all cities in annual growth, while, among major metro-areas, Kolkata (up 21%) followed by Hyderabad (up 12%) registered the highest annual growth. 

The Monster Employment Index India is a monthly gauge of online job posting activity based on a real-time review of millions of employer job opportunities culled from a large representative selection of career Web sites and online job listings across India.

Source : TOI

Thursday 29 August 2013

UML Class Diagram

Overview:

The class diagram is a static diagram. It represents the static view of an application. Class diagram is not only used for visualizing, describing and documenting different aspects of a system but also for constructing executable code of the software application.
The class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the modelling of object oriented systems because they are the only UML diagrams which can be mapped directly with object oriented languages.
The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is also known as a structural diagram.

Purpose:

The purpose of the class diagram is to model the static view of an application. The class diagrams are the only diagrams which can be directly mapped with object oriented languages and thus widely used at the time of construction.
The UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the application but class diagram is a bit different. So it is the most popular UML diagram in the coder community.
So the purpose of the class diagram can be summarized as:
  • Analysis and design of the static view of an application.
  • Describe responsibilities of a system.
  • Base for component and deployment diagrams.
  • Forward and reverse engineering.

How to draw Class Diagram?

Class diagrams are the most popular UML diagrams used for construction of software applications. So it is very important to learn the drawing procedure of class diagram.
Class diagrams have lot of properties to consider while drawing but here the diagram will be considered from a top level view.
Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application. So a collection of class diagrams represent the whole system.
The following points should be remembered while drawing a class diagram:
  • The name of the class diagram should be meaningful to describe the aspect of the system.
  • Each element and their relationships should be identified in advance.
  • Responsibility (attributes and methods) of each class should be clearly identified.
  • For each class minimum number of properties should be specified. Because unnecessary properties will make the diagram complicated.
  • Use notes when ever required to describe some aspect of the diagram. Because at the end of the drawing it should be understandable to the developer/coder.
  • Finally, before making the final version, the diagram should be drawn on plain paper and rework as many times as possible to make it correct.
Now the following diagram is an example of an Order System of an application. So it describes a particular aspect of the entire application.
  • First of all Order and Customer are identified as the two elements of the system and they have a one to many relationship because a customer can have multiple orders.
  • We would keep Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and NormalOrder.
  • The two inherited classes have all the properties as the Order class. In addition they have additional functions like dispatch () and receive ().
So the following class diagram has been drawn considering all the points mentioned above:
UML Class Diagram

Where to use Class Diagrams?

Class diagram is a static diagram and it is used to model static view of a system. The static view describes the vocabulary of the system.
Class diagram is also considered as the foundation for component and deployment diagrams. Class diagrams are not only used to visualize the static view of the system but they are also used to construct the executable code for forward and reverse engineering of any system.
Generally UML diagrams are not directly mapped with any object oriented programming languages but the class diagram is an exception.
Class diagram clearly shows the mapping with object oriented languages like Java, C++ etc. So from practical experience class diagram is generally used for construction purpose.
So in a brief, class diagrams are used for:
  • Describing the static view of the system.
  • Showing the collaboration among the elements of the static view.
  • Describing the functionalities performed by the system.
  • Construction of software applications using object oriented languages.

UML Activity Diagram

Overview:

Activity diagram is another important diagram in UML to describe dynamic aspects of the system.
Activity diagram is basically a flow chart to represent the flow form one activity to another activity. The activity can be described as an operation of the system.
So the control flow is drawn from one operation to another. This flow can be sequential, branched or concurrent. Activity diagrams deals with all type of flow control by using different elements like fork, join etc.

Purpose:

The basic purposes of activity diagrams are similar to other four diagrams. It captures the dynamic behaviour of the system. Other four diagrams are used to show the message flow from one object to another but activity diagram is used to show message flow from one activity to another.
Activity is a particular operation of the system. Activity diagrams are not only used for visualizing dynamic nature of a system but they are also used to construct the executable system by using forward and reverse engineering techniques. The only missing thing in activity diagram is the message part.
It does not show any message flow from one activity to another. Activity diagram is some time considered as the flow chart. Although the diagrams looks like a flow chart but it is not. It shows different flow like parallel, branched, concurrent and single.
So the purposes can be described as:
  • Draw the activity flow of a system.
  • Describe the sequence from one activity to another.
  • Describe the parallel, branched and concurrent flow of the system.

How to draw Activity Diagram?

Activity diagrams are mainly used as a flow chart consists of activities performed by the system. But activity diagram are not exactly a flow chart as they have some additional capabilities. These additional capabilities include branching, parallel flow, swimlane etc.
Before drawing an activity diagram we must have a clear understanding about the elements used in activity diagram. The main element of an activity diagram is the activity itself. An activity is a function performed by the system. After identifying the activities we need to understand how they are associated with constraints and conditions.
So before drawing an activity diagram we should identify the following elements:
  • Activities
  • Association
  • Conditions
  • Constraints
Once the above mentioned parameters are identified we need to make a mental layout of the entire flow. This mental layout is then transformed into an activity diagram.
The following is an example of an activity diagram for order management system. In the diagram four activities are identified which are associated with conditions. One important point should be clearly understood that an activity diagram cannot be exactly matched with the code. The activity diagram is made to understand the flow of activities and mainly used by the business users.
The following diagram is drawn with the four main activities:
  • Send order by the customer
  • Receipt of the order
  • Confirm order
  • Dispatch order
After receiving the order request condition checks are performed to check if it is normal or special order. After the type of order is identified dispatch activity is performed and that is marked as the termination of the process.
UML Activity Diagram

Where to use Activity Diagrams?

The basic usage of activity diagram is similar to other four UML diagrams. The specific usage is to model the control flow from one activity to another. This control flow does not include messages.
The activity diagram is suitable for modeling the activity flow of the system. An application can have multiple systems. Activity diagram also captures these systems and describes flow from one system to another. This specific usage is not available in other diagrams. These systems can be database, external queues or any other system.
Now we will look into the practical applications of the activity diagram. From the above discussion it is clear that an activity diagram is drawn from a very high level. So it gives high level view of a system. This high level view is mainly for business users or any other person who is not a technical person.
This diagram is used to model the activities which are nothing but business requirements. So the diagram has more impact on business understanding rather implementation details.
Following are the main usages of activity diagram:
  • Modeling work flow by using activities.
  • Modeling business requirements.
  • High level understanding of the system's functionalities.
  • Investigate business requirements at a later stage.

UML Object Diagram

Overview:

Object diagrams are derived from class diagrams so object diagrams are dependent upon class diagrams.
Object diagrams represent an instance of a class diagram. The basic concepts are similar for class diagrams and object diagrams. Object diagrams also represent the static view of a system but this static view is a snapshot of the system at a particular moment.
Object diagrams are used to render a set of objects and their relationships as an instance.

Purpose:

The purpose of a diagram should be understood clearly to implement it practically. The purposes of object diagrams are similar to class diagrams.
The difference is that a class diagram represents an abstract model consisting of classes and their relationships. But an object diagram represents an instance at a particular moment which is concrete in nature.
It means the object diagram is more close to the actual system behaviour. The purpose is to capture the static view of a system at a particular moment.
So the purpose of the object diagram can be summarized as:
  • Forward and reverse engineering.
  • Object relationships of a system
  • Static view of an interaction.
  • Understand object behaviour and their relationship from practical perspective

How to draw Object Diagram?

We have already discussed that an object diagram is an instance of a class diagram. It implies that an object diagram consists of instances of things used in a class diagram.
So both diagrams are made of same basic elements but in different form. In class diagram elements are in abstract form to represent the blue print and in object diagram the elements are in concrete form to represent the real world object.
To capture a particular system, numbers of class diagrams are limited. But if we consider object diagrams then we can have unlimited number of instances which are unique in nature. So only those instances are considered which are having impact on the system.
From the above discussion it is clear that a single object diagram cannot capture all the necessary instances or rather cannot specify all objects of a system. So the solution is:
  • First, analyze the system and decide which instances are having important data and association.
  • Second, consider only those instances which will cover the functionality.
  • Third, make some optimization as the numbers of instances are unlimited.
Before drawing an object diagrams the following things should be remembered and understood clearly:
  • Object diagrams are consist of objects.
  • The link in object diagram is used to connect objects.
  • Objects and links are the two elements used to construct an object diagram.
Now after this the following things are to be decided before starting the construction of the diagram:
  • The object diagram should have a meaningful name to indicate its purpose.
  • The most important elements are to be identified.
  • The association among objects should be clarified.
  • Values of different elements need to be captured to include in the object diagram.
  • Add proper notes at points where more clarity is required.
The following diagram is an example of an object diagram. It represents the Order management system which we have discussed in Class Diagram. The following diagram is an instance of the system at a particular time of purchase. It has the following objects
  • Customer
  • Order
  • SpecialOrder
  • NormalOrder
Now the customer object (C) is associated with three order objects (O1, O2 and O3). These order objects are associated with special order and normal order objects (S1, S2 and N1). The customer is having the following three orders with different numbers (12, 32 and 40) for the particular time considered.
Now the customer can increase number of orders in future and in that scenario the object diagram will reflect that. If order, special order and normal order objects are observed then we you will find that they are having some values.
For orders the values are 12, 32, and 40 which implies that the objects are having these values for the particular moment (here the particular time when the purchase is made is considered as the moment) when the instance is captured.
The same is for special order and normal order objects which are having number of orders as 20, 30 and 60. If a different time of purchase is considered then these values will change accordingly.
So the following object diagram has been drawn considering all the points mentioned above:
UML Object Diagram

Where to use Object Diagrams?

Object diagrams can be imagined as the snapshot of a running system at a particular moment. Now to clarify it we can take an example of a running train.
Now if you take a snap of the running train then you will find a static picture of it having the following:
  • A particular state which is running
  • A particular number of passengers. which will change if the snap is taken in a different time.
So here we can imagine the snap of the running train is an object having the above values. And this is true for any real life simple or complex system. In a brief, object diagrams are used for:
  • Making the prototype of a system.
  • Reverse engineering.
  • Modeling complex data structures.
  • Understanding the system from practical perspective.

UML Interaction Diagram Also called Sequence Diagram

Overview:

From the name Interaction it is clear that the diagram is used to describe some type of interactions among the different elements in the model. So this interaction is a part of dynamic behaviour of the system.
This interactive behaviour is represented in UML by two diagrams known as Sequence diagramand Collaboration diagram. The basic purposes of both the diagrams are similar.
Sequence diagram emphasizes on time sequence of messages and collaboration diagram emphasizes on the structural organization of the objects that send and receive messages.

Purpose:

The purposes of interaction diagrams are to visualize the interactive behaviour of the system. Now visualizing interaction is a difficult task. So the solution is to use different types of models to capture the different aspects of the interaction.
That is why sequence and collaboration diagrams are used to capture dynamic nature but from a different angle.
So the purposes of interaction diagram can be describes as:
  • To capture dynamic behaviour of a system.
  • To describe the message flow in the system.
  • To describe structural organization of the objects.
  • To describe interaction among objects.

How to draw Interaction Diagram?

As we have already discussed that the purpose of interaction diagrams are to capture the dynamic aspect of a system. So to capture the dynamic aspect we need to understand what a dynamic aspect is and how it is visualized. Dynamic aspect can be defined as the snap shot of the running system at a particular moment.
We have two types of interaction diagrams in UML. One is sequence diagram and the other is a collaboration diagram. The sequence diagram captures the time sequence of message flow from one object to another and the collaboration diagram describes the organization of objects in a system taking part in the message flow.
So the following things are to identified clearly before drawing the interaction diagram:
  • Objects taking part in the interaction.
  • Message flows among the objects.
  • The sequence in which the messages are flowing.
  • Object organization.
Following are two interaction diagrams modeling order management system. The first diagram is a sequence diagram and the second is a collaboration diagram.

The Sequence Diagram:

The sequence diagram is having four objects (Customer, Order, SpecialOrder and NormalOrder).
The following diagram has shown the message sequence for SpecialOrder object and the same can be used in case of NormalOrder object. Now it is important to understand the time sequence of message flows. The message flow is nothing but a method call of an object.
The first call is sendOrder () which is a method of Order object. The next call is confirm () which is a method of SpecialOrder object and the last call is Dispatch () which is a method ofSpecialOrder object. So here the diagram is mainly describing the method calls from one object to another and this is also the actual scenario when the system is running.
UML Sequence Diagram

The Collaboration Diagram:

The second interaction diagram is collaboration diagram. It shows the object organization as shown below. Here in collaboration diagram the method call sequence is indicated by some numbering technique as shown below. The number indicates how the methods are called one after another. We have taken the same order management system to describe the collaboration diagram.
The method calls are similar to that of a sequence diagram. But the difference is that the sequence diagram does not describe the object organization where as the collaboration diagram shows the object organization.
Now to choose between these two diagrams the main emphasis is given on the type of requirement. If the time sequence is important then sequence diagram is used and if organization is required then collaboration diagram is used.
UML Collaboration Diagram

Where to use Interaction Diagrams?

We have already discussed that interaction diagrams are used to describe dynamic nature of a system. Now we will look into the practical scenarios where these diagrams are used. To understand the practical application we need to understand the basic nature of sequence and collaboration diagram.
The main purposes of both the diagrams are similar as they are used to capture the dynamic behaviour of a system. But the specific purposes are more important to clarify and understood.
Sequence diagrams are used to capture the order of messages flowing from one object to another. And the collaboration diagrams are used to describe the structural organizations of the objects taking part in the interaction. A single diagram is not sufficient to describe the dynamic aspect of an entire system so a set of diagrams are used to capture is as a whole.
The interaction diagrams are used when we want to understand the message flow and the structural organization. Now message flow means the sequence of control flow from one object to another and structural organization means the visual organization of the elements in a system.
In a brief the following are the usages of interaction diagrams:
  • To model flow of control by time sequence.
  • To model flow of control by structural organizations.
  • For forward engineering.
  • For reverse engineering.

UML Component Diagram

Overview:

Component diagrams are different in terms of nature and behaviour. Component diagrams are used to model physical aspects of a system.
Now the question is what are these physical aspects? Physical aspects are the elements like executables, libraries, files, documents etc which resides in a node.
So component diagrams are used to visualize the organization and relationships among components in a system. These diagrams are also used to make executable systems.

Purpose:

Component diagram is a special kind of diagram in UML. The purpose is also different from all other diagrams discussed so far. It does not describe the functionality of the system but it describes the components used to make those functionalities.
So from that point component diagrams are used to visualize the physical components in a system. These components are libraries, packages, files etc.
Component diagrams can also be described as a static implementation view of a system. Static implementation represents the organization of the components at a particular moment.
A single component diagram cannot represent the entire system but a collection of diagrams are used to represent the whole.
So the purpose of the component diagram can be summarized as:
  • Visualize the components of a system.
  • Construct executables by using forward and reverse engineering.
  • Describe the organization and relationships of the components.

How to draw Component Diagram?

Component diagrams are used to describe the physical artifacts of a system. This artifact includes files, executables, libraries etc.
So the purpose of this diagram is different, Component diagrams are used during the implementation phase of an application. But it is prepared well in advance to visualize the implementation details.
Initially the system is designed using different UML diagrams and then when the artifacts are ready component diagrams are used to get an idea of the implementation.
This diagram is very important because without it the application cannot be implemented efficiently. A well prepared component diagram is also important for other aspects like application performance, maintenance etc.
So before drawing a component diagram the following artifacts are to be identified clearly:
  • Files used in the system.
  • Libraries and other artifacts relevant to the application.
  • Relationships among the artifacts.
Now after identifying the artifacts the following points needs to be followed:
  • Use a meaningful name to identify the component for which the diagram is to be drawn.
  • Prepare a mental layout before producing using tools.
  • Use notes for clarifying important points.
The following is a component diagram for order management system. Here the artifacts are files. So the diagram shows the files in the application and their relationships. In actual the component diagram also contains dlls, libraries, folders etc.
In the following diagram four files are identified and their relationships are produced. Component diagram cannot be matched directly with other UML diagrams discussed so far. Because it is drawn for completely different purpose.
So the following component diagram has been drawn considering all the points mentioned above:
UML Component Diagram

Where to use Component Diagrams?

We have already described that component diagrams are used to visualize the static implementation view of a system. Component diagrams are special type of UML diagrams used for different purposes.
These diagrams show the physical components of a system. To clarify it, we can say that component diagrams describe the organization of the components in a system.
Organization can be further described as the location of the components in a system. These components are organized in a special way to meet the system requirements.
As we have already discussed those components are libraries, files, executables etc. Now before implementing the application these components are to be organized. This component organization is also designed separately as a part of project execution.
Component diagrams are very important from implementation perspective. So the implementation team of an application should have a proper knowledge of the component details.
Now the usage of component diagrams can be described as:
  • Model the components of a system.
  • Model database schema.
  • Model executables of an application.
  • Model system's source code.