In: Computer Science
A couple of questions that I want to understand better.
Class diagrams will be treated from top to bottom. They are the graphical representation and represents multiple aspects of the application. Few points to be kept in mind while drawing :
1.Name of class diagram should be quite meaningful and apt for the aspect of the system.
2.Each element and their relationships have to be identified easily and before itself.
3.Attributes and methods of each class should be clearly identified. For Each class there should be minimum number of properties specified.
4.Each aspect of the diagram should be clearly understandable to the developer.
5.The diagram should be drawn on paper in a more clearer way and it should be revised as many times as possible to make it correct.
Clean Object hierarchy diagram is closer to the actual system behaviour. It shows the static view of the system at particular instance. It can be summarised as forward and backward engineering, object relationships.
Information hiding means separating the description of how to use a class from implementation details. This is important because it reduces complexity and prevents anyone to change code.
To instantiate an object is to create an object using a new keyword. We use rectangle to represent an Object. Objects usually represent a particular instance.
Cohesion describes the relationships within the modules. It is the degree to which all elements directed towards performing a single task are contained in the component. This is required because a good software design will have high cohesion.
Decoupling is the process of making something that was tightly coupled less or not at all. Flexible systems should have loose coupling.
Inheritance allows to create classes using the existing classes. The new class can have new implementation as well as the behaviour from the parent class. This is required and makes it easier to create and maintain an application. It also helps for the reuse of functionality. Data members are inherited from parent class.
Polymorphic represents something which is having many forms referring to both objects as well as methods. It allows to code to an interface that reduces coupling. Helps in increasing reusablity and make it easier.
Linked lists are preferable when you need constant time insertions, deletions from the list. These are used when you don't know the length of the items and random access is not required.
Arrays are preferable when you need random or indexed access to elements.When the number of items are known. When you wanted to iterate through each element and also use pointer. When you wanted exact memory to be used.
Queue is first in, firstout(FIFO)
Stack is last in, first out (LIFO)
Arrays and lists are random access. They are flexible as well as easily corruptible
Lists are used when you wanted to have a quick access of the element and when you wanted to arrange in a organised manner. Elements can be added to the end. It has high random access speed.