Professional Documents
Culture Documents
Abstract classes are general classes and are used when generalization/specialization is included in
the design. The general class becomes the abstract class. The abstract class has no direct objects or
class instances, and is only used in conjunction with specialized classes. Abstract classes usually
have attributes and may have a few methods.
❑ We need to create an abstract class as a base class because it will transmit its default
feature and create a derived class from this abstract base class performing a similar type of
function.
Example
Explanation
Student and Employee are subclasses, because they have different attributes and methods. An
employee does not have a grade point average and a student does not have a salary. This is a simple
version, and does not include employees that are students and students that work for the university.
If these were added, they would be subclasses of the Employee and Student classes. Employee has
two subclasses, Faculty and Administrator, because there are different attributes and methods for
each of these specialized classes.
Subclasses have special verbs to define them. These are often run-on words, using isa for “is a,”
isakinda for “is a kind of,” and canbea for “can be a.” There is no distinction between “is a” and “is
an;” they both use isa.
In above example, car model has a model name, year, base price. A physical car has a serial no, color,
options. A car model describes many physical car and stores common data about them. A car model is
referred as metadata which relates to the data of physical care. A class descriptor object contains
feature and they can have their own classes which are known as meta classes.
CANDIADTE KEY
A candidate key for a class is a combination of one or more attributes that uniquely identifies objects
within a class. The collection of attributes in a candidate key must be minimal; no attribute can be
discarded from the candidate key without destroying uniqueness. No attribute in a candidate key can
be null. A given attribute may participate in multiple candidate keys.
In other words we can say that in a relation, there can be more than one attribute
combination possessing the unique identification property. These combinations, which can
act as primary key, are called candidate keys.
❑ In Object Modelling, the constraints define the relationship between objects. They may also
define the relationship between the different values that an object may take at different times.
❑ In Dynamic Modelling, the constraints define the relationship between the states and events of
different objects.
❑ In Functional Modelling, the constraints define the restrictions on the transformations and
computations
Representation − A constraint is rendered as a string within braces.
Example − The following figure shows a portion of DFD for computing the salary of employees of a
company that has decided to give incentives to all employees of the sales department and increment
the salary of all employees of the HR department. It can be seen that the constraint {Dept:Sales}
causes incentive to be calculated only if the department is sales and the constraint {Dept:HR} causes
increment to be computed only if the department is HR.