OK, welcome back again.
So now we're going to go through an exercise, I'm going to show you the exercise that such, and then
I would like you to post it with you and try to do a solution to it yourself.
And then when you feel comfortable with that, then you should continue to see that, because I'm going
to give you one solution to it.
And as in all the cases, there are no true solutions here, just more like more or less understandable
versions, I will say.
But we're going to go back to our flight example that we already have used to actually here because
we produced an A class, a class model in that we remember that.
So I'm going to use that here as the basis for doing a package structure of that flight model.
So here was the result that I did.
And you probably have done your own.
And of course, you can use that instead, if you like, or you can take any other one example you have.
But here's a number of classes.
Is not a complete domain model.
Probably you probably would like to dig out some more information about what a passenger is and what
a flight is, a little bit more like that.
And there is no attributes and so on.
But let's use this as a basis.
So what I would like to do here is to post a video now and then try to create your package structure
for this class diagram.
But you should keep in mind, as I said, that this domain is a little bit to few classes.
And right now probably you probably could could come up with maybe 20 more classes if you had a real
workshop about this.
But let's keep the example a little bit more simple.
So so the for example, the rule saying that you should have five to nine classes in each package is
maybe not applicable in this situation.
So I think it's fine.
For this example, you maybe just have a two or one or actually two or three classes in each day packages.
So try to think about how a person that is a skilled person in this domain would think about what are
the relevant packages here?
OK, I think it will be like 20 minutes for this supposed to do now look at the class diagram and try
to figure out package structure and also try to derive the dependencies.
And it's also actually a good thing here is to question maybe some of the associations and see whether
they actually should have an navigability that they are missing.
Depending on the package structure dependencies, you find out, OK, like see you back again in about
20 minutes then.
OK, I hope I wasn't too hard, but I also hope it wasn't too easy.
It should be a little bit hard.
If you've done this like 100 times already, then you probably do it in a couple of minutes.
If you've never done it, you might have a little bit trouble coming into the thinking.
But I will go through one example.
Sorry, I will go through one solution now how I would probably do this.
But as I said, it's no one true solution here.
You can probably do it in a couple of different ways that make sense.
Okeydokey, so I would probably think that the ticket taker route ticket unit belongs together in some
way to a package call, which I call tickets here, or ticket management or tickets or something like
that.
I will probably also put in the passenger here, possibly the passenger could have been a package in
his own if we knew more about that concept.
But for this example, I actually put the passenger into the tickets package right now.
Then I will look into the airplane in the seat where we have an aggregation structure saying that the
seats are belonging to the airplane and I will stick them together in what I hear call airplanes.
OK, and we know that there is an association going from the ticket unit to the airplane.
So that already had a navigability in one way here.
Then I will group the flight and the span.
So we said that you could book particular span's in the flight.
Right.
And I would think that they are actually a grouping together here.
So I will group them in a package called flights.
Then I will add on the associations from the ticket units.
So we will have two associations, one association to a flight and one association to particular spans
within that flight that the ticket unit is using.
And we also add on the association from the flight to the airplane.
Then I will say that the route and the link belong together because the route is defined based on a
set of basic links and I will call that packages.
I would call that package routes and add on the association from the span.
So I already have the the navigability s in the model bag.
The class was actually located more to the routes and expanding the time to the routes and the in a
diagram.
But here I think it makes more sense to actually say that the span belongs to the flight subdomain and
the owling in the routes are kept together.
And then lastly, I will add the airport as a separate one, because here I also think that if we would
have continued this, the airport would probably grow as a subdomain with much more other details put
into it.
And then we have the two associated with going from the link to the airport, the Origin and the Destination
Association.
OK, so this would probably be my first sketch.
Let's look and see which package dependencies we would derive based on this.
So based on this, we will have one package dependency between the tickets and the flight.
You know, even if we had two associations going on here, I will have one dependency from tickets to
airplanes.
We will have one dependency from flights to airplanes.
All these are fine from an evaluation point.
And we have one dependency from flight to routes.
However, we will actually get to dependencies in each direction, from airports to routes and for routes
to airport because.
And why was that?
That was because the association didn't have an navigability.
So I would then probably go back to my class model and see whether actually it makes sense to say that
the airlink is pointing to the airports, but not the vice versa, which I think makes sense.
So I would actually probably reduce the class model to something like this and then we can actually
remove the dependency in one of the directions.
So this would be the final package structure with the dependencies based on that class model.
As I said, this is one solution, probably many, but this is how I would think about it when I did
it.
Very good.
So that was the end of that exercise and the possible solution to that example.
See you in the last lecture for this section, which is actually the last lecture of the whole course.