So how do we represent a class in a class
diagram? Class is represented as a rectangle with three parts. The
first part is the class name. Classes should be named using
the vocabulary of the domain, so we should pick names that
make sense. And the normal naming standard requires that the classes
are singular nouns starting with a capital letter. The second part
of the class are the attributes of the class, where the
set of attribute for the class, we find the state for
the class. And, we can list an attribute simply by
name, or we can provide the additional information. For example,
we might define the title of the attribute, and we
might also define the initial. Value for the attribute. Finally, the
third part of the class consist of the operations of
the class. And normally, the operations of the class are represented
by name, with a list of arguments. That the operation
will take as input, and with a result type. So the
type of the result produced by the operation. Something
else you can notice in this representation is the
fact that there is a minus before these attributes
and a plus before this operation. This indicates what is
called the visibility of these class members. So the
minus indicates that the attributes are private to the class.
So only instances of this class, roughly speaking, can
access these attributes. And notice that this is what allows
to enforce the information hiding principle, because clients of
the class cannot see what's inside this box, what are
these attributes. The plus conversely indicates that this is a
public operation. So something that is visible outside the class.
And, in fact, normally, this is what we use to
define the interface for my class. So we encapsulate the
state of the class and we make it accessible to
the extent that we want and that is needed through
a set of public operations. Last thing I want to
note is the use of these ellipses that we can
utilize if we want to indicate that there are more
attributes for example, or more operations. But we just don't
want to list them now. Okay now that we know what
a class is, and how it is represented, let's start
our analysis of our course management system. By identifying the
relevant classes in the system, we need to bring back the
description of our system. And what we want to
do, is that we want to go through the description
and underline the relevant nouns in the description. And here
I encourage you to stop the video and to do
the exercise of underlying such nouns yourself before listening to
my explanation into how I do it. For example in
this case I might want to underlined the registration manager which
is a noun and probably a relevant one. The scheduling
algorithm, also seems like a relevant concept, so
is the course. The course offerings, again, course offerings
over here. Definitely, the students seem to be a
relevant noun and so is probably the registration form
and the professors. Okay, so, at this point, I
identified seven possible classes for my system. So, what
I'm going to do is simply to create classes for
each one of these nouns. So my initial class
diagram looks exactly like this, with the seven classes where
for each class, I picked the name that is representative of
the domain. So, in this case, it's pretty straightforward. The
registration form is called registration form, the student is called student
and so on and so forth. But you can already
see how this analysis method is starting from a description of
the real world and it's just identifying objects or classes
in the real world and transforming them into entities in my
analysis document.