OK, back again now we're going to talk about generalizations, so that's another type of relation that
you model UML.
So we talked about associations and there are instances which are links and now we're going to make
generalizations.
So generalisations is the way to express general implication.
We talked about that also when we talked about logic and the philosophical foundation.
So this, for example, in predicate logic, says that all X for all X, if X is a man, then X is also
an animal.
Right.
And that is called like the general implication here of saying that man is an animal.
So generally the question becomes generalizations in general.
So let's say that we have notions about different species here and we think that they are all animals.
Some are mammals, some old birds and other types of animals.
And in mammals section, we also have Homo sapiens, elephants, cows and so on.
The generalization relationship is then shown here is sea as a solid line with the non solid triangle
in the parent.
And so animal is the most abstract concept and that is what the arrow is pointing at.
So we have mammals and birds and within mammals we are Homo sapiens, elephants and cows.
So that is the way you are relating concepts when you think that they are specifying a more general
concept.
So the generalization is actually the the uppermost, more abstract concept.
So that's the generalization and the specialization part of the relation.
So if we then talk about the association and links that we had and the kind of the important difference
here between association and links and generalizations.
So in any case here, let's say we have a couple of cows and we have a couple of barns, then we can
have links between those subjects specifying which cow that belongs to, which barn, maybe.
Right.
And then we also have an association between a barn and a cow that states the account of the ownership
or location.
So here we actually have instances out in the world that have that have relations with each other.
However, the generalization a little bit difference because here we have cows and that they are surrounded
by this kind of that it's a set of cows.
And we have a class that describes that set.
Then we have mammals and we have animals and so on.
But we won't have any animals that are only mammals.
They will they will be cows or human beings or other type of the lowest level classes.
That's the wire where they are that that's which class they are instantiated out from.
So I'm not only a mammal, I'm a human being, which is a mammal.
So the generalization is something going on on the class level and not between the objects.
Right.
So it's not instantiated all in the same way as an association, so a cow relates to mammal and mammal
relates to animal, but it's not the actual instances that relate to each other.
So hence, by definition, there are only objects of the lowest level classes in such a structure.
So you cannot actually have an object that is an instantiation of any of the super types in Generalisation
Network.
Hence, that is actually shown by saying that all superordinate classes in the generalisation structure
are what is called abstract, that means that you cannot instantiate them directly.
So you need to subtype them, for example, in this case, we have party, legal entity, person and
legal entity could be a corporation or a state, then the actual instances would be a corporation or
a state or the person here.
We cannot have any instance of a legal entity that could treat it as a legal entity.
But that is just looking at it from another abstract level.
But it's really an extension of either a corporation or a state that is shown in UML.
But by putting the name of the class in italics, that means that that class is abstract and cannot
be directly instantiated in any of its subtypes needs to be instantiated in Stelle.
Instead, you can also and that are shown here on a generalization, say that it's, for example, incomplete.
So you can have different you could describe the analyzation set by saying here and this example that
two types, two subtypes of legal entity are a corporation and states.
But they could potentially be more.
Yeah.
And good, but you can slice the same pie in many different ways, right?
So let's take this example to let's see here that we have a set of accounts.
So these are all tier counts.
And I can slice them in many different or technical ways here.
So I can say that these are like the subtypes, our business accounts and personal accounts.
But if I'm instead saying that the important stuff here is whether they are savings accounts, checking
accounts, money market accounts and so on, then it won't have the same distinction as personal and
business.
So you could actually do a small state that a class could have multiple generalisations sets.
So we could say that an account could have sunk to sometimes pujari the business accounts and personal
accounts or subtable savings accounts, checking accounts and money market account.
That's fine.
Even if I think personally that this type of modeling makes it more abstract and a little bit harder
to to understand.
Maybe you could model this in another way and maybe think about that.
But maybe you should know that it is possible to do it your email.
You can also download or describe what is called the constraints within the curly brackets here.
And you can set and give them a name.
So you can say that the first subsid here I call the liability type and the second is the account type
and the first one is actually complete and disjoint and the second one is incomplete and disjoined.
So disjoined means that they aren't overlapping each other.
Complete means that there are no more subtypes.
So the other one is not overlapping either, but it's incomplete.
So there could be other I'm not covered the whole set of objects here right now in this diagram.
So as I said, so this is kind of a special case of generalization is typically not a thing you start
doing from the very first day, probably because it also makes it a little bit harder to understand.
But you should know that and you might need it.
But this is a very powerful thing.
So what if you need to speak about the type before you have an object to speak about?
So that's very common if you think about it.
So and this is called power types.
And let's start with an example.
So if I would like to say that Maple's tend to grow in the Northern Hemisphere, but this specific tree
is in the south is in South Africa.
So what I then would like to say I would like to say something generically about this species are being
Maple's for saying that they tend to grow in the northern hemisphere.
But then I would like to talk about this specific object of of a maple.
And that specific object actually grows in South Africa.
So here I'm talking about and describing the class level and the object level.
In many situations, we need to describe the class level even if we don't have an object to describe.
And what do you need to do then?
They need to use something that is called power types.
So if we take this example, we can say that we have a tree class and we have a generalization structure
of tree species, which, of course, is incomplete here.
So this is just the example of tree species, maple, apricot and American Al.
All right.
So I can then say that in actual location of a tree, if I have a tree object to speak about is in a
specific EUROPEO graphic location.
But then I can't say anything about generically what Maple's, for example, where they tend to grow
because I cannot put that on a specific object.
Right.
So I need to have something which is OPOWER type, it's called of a tree and I call that tree species
and tree species.
I can see something generically about.
So here I can say that the general location of a tree species called maple is a number of a range of
different geographical locations.
So OPOWER type is shown actually on a class with a stereotype.
So this is a predefined stereotype, Kalpowar type and the same, and the class have the same name as
the generalizations set and it's stereotyped, Ippolito Basson said.
So in this case, the generalization said, Why has the name of tree species and has the power type
also gets the name tree species and stereotyped as palletize?
So what we are doing here, actually, if I should try to explain it in words, it might this meaning
might be look, look a little bit abstract and hard to grasp, but if we take it word for word.
So OPOWER type is a class whose instances are also some.
Classes of another class.
So we're saying that a power type tree species here is a class.
All right, whose instances, because what is the instance of the tree species here, the instance is
called Maple and maple happens to be a subclass of another class that was called tree.
So what is an instance in the left side here is actually the class in the right side.
So a pineapple type is a class, for instance, are also subclasses of another class.
And by doing that construct, then we could describe things about the class on kind of a metal level.
He's not talking about specific objects of that class.
And this is very, very useful and we use it a lot when we do conceptual analysis.
So this is something you should start to try to get your head around, actually, because that will
help you express very much more powerful things.
So the example, again, the maple, which is a tree species, have a general location in North America
and a specific instance is this specific maple and that happens to actually grow in South Africa.
Then there is something called multiple enhancers.
So one class could actually inherit multiple classes.
So you don't have to be involved in just one generalization structure.
So let's say that we have a concept of a boat, we have a concept of a car, and we also have that a
concept of amphibious car.
So a class might specialize more than one class.
So we have then the vehicle may be on the top here.
And then we say that both the car and about our vehicles.
But then we have a combination of a car and a vote, which is an amphibious car.
However, I should say here as well, when we also talked about multiple generalizations sets on the
same class, also multiple inheritance could make the model a little bit hard to grasp.
And there are probably often ways to model around that.
So you can probably express what you like without using multiple Huerter.
So be a little bit careful here because as I said, when you're creating diagrams, the whole purpose
of creating them is not just so you should understand them, is to be a communication tool and then
you should try to keep them as clear and easy as possible.
So make them more easier if is possible to do it.
OK, summary generalizations then.
So we have this generalization example here.
The generalization relationship is shown as a solid line with a bonfield arrowhead pointing at the abstract
class, OK, and the rules of the road generalize.
The roles in this relationship is actually called generalization and that's apparent.
And specialization, which is the child.
And the whole relation is called the general generalization.
A class can have multiple generalizations such which could be constrained and such as incomplete, disjoined
and so on.
And this sets can have a name.
And if they have a name and includes a power type, that name or generalizations that will have the
same name as the class for the power type.
So if needed, a specific class called a power type can be a model for each generalization set and then
it will be stereotyped as a power type as well.
But this is I've shown you here, quite complex examples of how to use generalizations and you should
know about them at least as a model or a facilitator or workshops.
But it should be a little bit careful when you're using them and also in general terms, using generalizations
and also applies to packaging later on could get you quite lost or at least your audience.
So be a little bit to think about when you use them.
So I think this is a very good example of this.
So allegedly this text came from and taxonomy in the animal kingdom and it's been attributed to an ancient
Chinese and so be.
Celestial emporium of the benevolent benevolent knowledge.
So this is like this on those remote pages, is it written that animals are divided into a those that
belong to the Emperor B and bold ones, C, those that are trained, D, suckling pigs, E, mermaids,
F, fabulous ones, G, stray dogs, h, those are included in this classification levels.
Strange I those that tremble as if they were mad j innumerable once k those drawn with a very fine camel's
hairbrush.
L others like that's kind of generically m those that have just broken a flower ways and and those that
resembles flies from a distance which could become anything if the distance is far away enough.
So just to this example shows you that if you're trying to make generalizations and grouping come out
of a larger set into subsets, you can end up in very strange classifications that maybe make sense
to you, but might not be sensible for others to understand and grasp.
Very good.
So that most generalizations, we're making good progress here.
So now we're going to go into the actual last element, the amount that we're using, and that's packages.
Great zero.