Thursday, February 9, 2012

.NET interview questions: - What are object diagrams in UML?

One of the most expected .NET interview questions on Unified Modeling Language (UML) asked to software engineer during .NET interview.

Class represents shows the static nature of the system. Class diagrams shows the types and how they are linked. Classes come to live only when objects are created from them. Object diagram gives a pictorial representation of class diagram at any point of time. Below figure ‘Object diagram’ shows how a class looks in when actual objects are created. We have shown a simple student and course relationship in the object diagram. So a student can take multiple courses. The class diagram shows the same with the multiplicity relationship. We have also shown how the class diagram then looks when the objects are created using the object diagram. We represent object with Object Name: Class Name. For instance in the below figure we have shown ‘Shiv : ClsStudent’ i.e ‘Shiv’ is the object and ‘ClsStudent’ the class. As the objects are created we also need to show data of the properties, the same is represented by ‘PropertyName=Value’ i.e. ‘StudentName=Shiv’.

Figure: - Object diagrams

The diagram also states that ‘ClsStudent’ can apply for many courses. The same is represented in object diagram by showing two objects one of the ‘Computer’ and the other of ‘English’.

Also see the following video on Object diagram in UML as follows: -



Learn more on important .NET interview questions

Regards,

From more on author’s blog related to Most asked .NET interview questions click and visit

No comments: