A use-case diagram is a uml diagram of how different types of users/actors interact with the potential system. The diagram describes the goals of the users, the interactions between the users and the system, and any required behaviours of the system in satisfying these goals. A use-case model consists of a number of model elements. The most important model elements are: use cases, actors and the relationships between them.
Association
Association is a broad term that encompasses just about any logical connection or relationship between classes. For example, passenger and airline may be linked as above
Directed Association
3 Directed Association refers to a directional relationship represented by a line with an arrowhead. The arrowhead depicts a container-contained directional flow.
Reflexive Association
Reflexive Association occurs when a class may have multiple functions or responsibilities. For example, a staff working in an airport may be a pilot, aviation engineer, a ticket dispatcher, a guard, or a maintenance crew member. If the maintenance crew member is managed by the aviation engineer there could be a managed by relationship in two instances of the same class.
Multiplicity
Multiplicity is the active logical association when the cardinality of a class in relation to another is being depicted. For example, one fleet may include multiple airplanes, while one commercial airplane may contain zero to many passengers. The notation 0..* in the diagram means “zero to many”.
Aggregation
Aggregation refers to the formation of a particular class as a result of one class being aggregated or built as a collection. For example, the class “library” is made up of one or more books, among other materials. In aggregation, the contained classes are not strongly dependent on the life cycle of the container. In the same example, books will remain so even when the library is dissolved. To render aggregation in a diagram, draw a line from the parent class to the child class with a diamond shape near the parent class.
Composition
is very similar to the aggregation relationship, with the only difference being its key purpose of emphasizing the dependence of the contained class to the life cycle of the container class. That is, the contained class will be obliterated when the container class is destroyed. For example, a shoulder bag’s side pocket will also cease to exist once the shoulder bag is destroyed. To depict a composition relationship in a UML diagram, use a directional line connecting the two classes, with a filled diamond shape adjacent to the container class and the directional arrow to the contained class.
Inheritance / Generalization
Inheritance refers to a type of relationship wherein one associated class is a child of another by virtue of assuming the same functionalities of the parent class. In other words, the child class is a specific type of the parent class. To depict inheritance in a UML diagram, a solid line from the child class to the parent class is drawn using an unfilled arrowhead.
Realization
Realization denotes the implementation of the functionality defined in one class by another class. To show the relationship in UML, a broken line with an unfilled solid arrowhead is drawn from the class that defines the functionality to the class that implements the function. In the example, the printing preferences that are set using the printer setup interface are being implemented by the printer.
So lets recap on what we have covered over the past few weeks, to simplify OOD and OOP, we use OOD to enable us to create a collection of diagrams and documents to enable us to organise our understanding of a system or game to then enable the programmers to use a defined programming style used to organize code in OOP.
Video games can have anywhere from a few thousand lines of code, such as the example of Cut the Rope of wich has 15,000 lines to millions of lines of code Crysis has over a million.
https://lh5.googleusercontent.com/IFB_KaDWAkmDX9HNB-nxrLFw89Nd5OVNEW3RZCzUoj23cSRMqVLkJ5Lkck2XfOwUuiDc1rlQ=s640-h400-e365
States are the characteristics of the object, or the words you would use to describe it, and usually take the form of is or has descriptors. (Remember our video) A computer is either on or off, a chair has four legs, and you have a name.
Behaviors are the things the object can do, or the actions the object can perform, and are usually verbs that end in "ing". You are sitting, using a computer, and reading this article.
We must remeber that the whole purpose of OOD and OOP is to create reusable code by following the DRY (Don't Repeat Yourself) method: write the code once and then reuse it, rather than copying and pasting.
Uk Creative Industries - International Stratergy driving global growth for the uk creative industries is a plan to double creative industries services exports by 2020 to £31 billion (UK GOV)
To identify what the objects are in Asteroids, try describing it. Wikipedia describes Asteroids as follows: The objective of Asteroids is to score as many points as possible by destroying asteroids and flying saucers. The player controls a triangular-shaped ship that can rotate left and right, fire shots straight forward, and thrust forward. As the ship moves, momentum is not conserved – the ship eventually comes to a stop again when not thrusting.
Think about what in this description could stand alone, or the things that are described that could have state and behavior. These become our objects.
The objects for Asteroids are: a ship, an asteroid, a flying saucer, and a bullet (can't forget those!). The cool thing about objects is that we normally describe things in terms of objects in everyday talk, so they usually reveal themselves through a description.
The classic game of Asteroids
Now that we have identified our objects, let's define the state and behavior for one of them: the player's ship. Think about what attributes describe the ship; these are its states. Then think about what the ship can do; these are its behaviors.
A ship has states of:
rotation
momentum
thrust
and behaviors of:
turning
moving
firing
I'll let you determine what the remaining objects' states and behaviors are.
OOD and OOP in action, Click Here
The Uk games development sector is reported to contribute £1 billion to the UK Gross Domestic Product per year. (TIGA)
The player controls Pac-Man through a maze, eating pac-dots or pellets. Four enemies [ghosts] roam the maze, trying to catch Pac-Man. Near the corners of the maze are four larger, flashing dots known as power pellets that provide Pac-Man with the temporary ability to eat the enemies. The enemies turn deep blue, reverse direction and usually move more slowly.
For Pac-Man, there are three objects:
Pac-Man,
a ghost,
a pac-dot.
A power pellet isn't really its own object because it's a special pac-dot (we'll talk about what to do about this in a later article). We'll describe the ghost object because it's more interesting. The ghost has states of: color name (+1 if you can name all the ghosts off the top of your head) state (eatable or not) direction speed and behaviors of: moving changing state
Using your newly gained skills from the previous weeks activities in the sequence diagrams, now start to construct a sequence diagram for your Mario worlds 1-1 walk through.
The Uk games sector is generates £2 billion in global sales each year. (TIGA)
Links to Learning Outcomes |
Links to Assessment criteria |
|
---|---|---|
Anonymous Assessment - Learners assess an anonymous piece of work containing deliberate mistakes against given success criteria.