Okay, so this is our first, class diagram.
>> So, let me ask you something about.
>> Okay.
>> What we've done so far. I also sent, in what
I sent you, I also had some stories about how the actual
>> Library is used. You asked me to do
that and are we going to take, use that here?
>> Glad you asked actually. yeah. Those are, you know, what we call use
cases, or what we will use as scenarios kind of things that we will
use to derive use cases. And they're also a very good
way of extracting requirements. We're not going to look at them right
now because now, because we're more working on kind of the static
structure of the system. But after we're done with the class diagram,
you know, we will do it at a different time. But
we're going to use those to see how the
libraries actually use them, and see whether we can get more
information that we can use to refine our requirements based on that.
>> Okay.
>> Okay,
So, for now, we'll just focus in on the,
structure, but, just so you know, I'm,
I'm glad you sent them, because they were going
very useful as well.
Okay. So let's see. Well, first of all, let
me, seems like that this is already pretty crowded,
right? We have a number of, classes. So let's
see if there's, some class that may be superfluous and
we can model in a different way. So, for
example, you, while, while thinking of this I was thinking,
the library card, it doesn't really contain much
information, right? So is it basically just the number?
The card has a number on it. We have a separate vendor that does that for us so.
>> Oh.
>> We don't need, it doesn't need to be part of this system,
we just have to make sure that every patron has a library card.
>> Okay, so basically for you, in a sense, the library
card is just an ID that gets associated with a patron.
>> That's right.
>> So I think that the best way to represent this, I mean, unless you
need an entity because you are creating it
yourself, but it seems like you are not.
I would just remove this one and I would like to put this,
basically to take the library card number and add it to the pattern.
>> Okay, makes sense.
>> Okay, so I'll add it here. And as
an additional attribute. Okay, and it will eliminate this class.
>> Okay.
Oh, and, wait a second, so I guess
also the child needs a library card number, right?
>> Child needs a library card number, but let me ask you about that. Is,
is child a separate class, or is it just another kind of patron?
>> Oh, I see, I see. Because, yeah, it
is sort of a special patron, right? And, so
maybe we should, maybe we should represent it as
a kind of a refinement of the patron.
Hm, but then that made me think. So what is
the only thing that characterizes children? Is it just the age?
>> Well, if they're, that they can't check out more than five books.
>> Okay. And the, and the only difference is the
fact that they are less than, you know, twelve years old.
>> Twelve or less, right.
>> Twelve or less. So, I guess, you know, I would probably
like to represent this by making the age explicit in the patron rather
than to represent it as a class. And I'll tell you why,
because one, one of the issues, and you know, that might happen
again, is that, basically, there are patrons that are children. And they're
no longer children, when they come you know 13 or older right.
>> Right.
>> And if we represent them with a separate class in a sense, then we
cannot really change the type of an instance of these classes.
So we're left to kind of destroy the patron, create
a new one, so that means we also have to transfer
any history we want to keep history and so on.
So I, I think I kind of like better the idea
that I represent the age exclusively in
the patron, and then I'll behave differently, based on whether the
patron is 12 years old, or younger, or 13 or,
13 or older. This, do you see any problem with that?
>> It makes things a little simpler.
>> Okay,
and we actually, it allows us also to eliminate
one class here. So I'm going to proceed this way.
I'm going to eliminate the children class, and I'm going to
put the age in the patron. Okay, and let me
see. But in this spirit, actually, something else that jumps
at me is this idea of the bestseller, because I
kind of feel like, we might have the same
problem. So, what is the story? What is a bestseller.
>> Well it's
an item that we want to restrict how
long people can keep, because there is such demand for it.
>> I see, and so basically a book that's a
bestseller, like the New York Times bestseller, is a bestseller forever?
>> No, no, no it's hot for
awhile, and then it becomes just a regular item.
>> I see. Hm. Then I guess it's a
similar situation to the one I was mentioning before, right?
>> Okay.
>> That if we have a book,
it will kind of have to change its type if it becomes a best seller.
Then we have to change its type again, if it's no longer a best seller.
>> Right.
>> So it seems to me that a better
way to represent this, is just to eliminate this BestSeller
class and instead, I'm going to put the best seller
attribute, which would just be a Boolean in the book.
>> Okay, what do you mean by Boolean?
>> Right. We don't know what Boolean is, right? The Boolean is
basically just a number. It can have two values, right? True or false.
>> Okay.
>> So we usually, normally use it
in this in this case. Imagine one, zero,
right? Then it's just kind of the basic.
>> Okay.
>> You know, the bits, right?
>> Okay.
>> So, this is just telling us, it's like a flag
that is telling this book is a best seller, or not.
>> Okay.
>> It's very easy to change this value and make a book a best
seller or not a best seller, than
just creating and destroying instances of these classes.
>> Okay, makes sense.
>> Okay, so at this point, this already looks better, right? Because we have,
less classes, and I think we did, yeah, we
did some serious cleanup. That's good. Okay, so now that
we eliminated some of this, what I would like to
do, as I said, we are going to both clean
up, but also refine. I would like to go
back to our, requirements and see whether we can identify
additional attributes for this, class that maybe are not as
obvious as the one that we saw so far, okay?