2019_2020:s3:concprogobjet:td:td3
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
2019_2020:s3:concprogobjet:td:td3 [2019/09/22 16:48] – [Hand class] blay | 2019_2020:s3:concprogobjet:td:td3 [2019/09/27 11:26] (current) – blay | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Conception d' | ||
+ | |||
+ | |||
EN CONSTRUCTION | EN CONSTRUCTION | ||
+ | https:// | ||
+ | //The broad domain of the case study is crisis management systems, i.e. software that facilitate coordination of activities and information flow between all stakeholders and parties that need to work together to handle a crisis. Crisis management systems can be used to handle many types of crises (e.g., natural disasters, epidemics, accidents, attacks, etc...) and may have to interface and interoperate with different types of external services (e.g., military systems, police systems, government, medical services, etc...). Crisis management systems also exhibit many non-functional properties, e.g. they must be highly available, dependable and secure.// | ||
- | https:// | + | **Objectifs |
- | + | * Modéliser une application un peu plus complexe en utilisant à bon escient vos connaissances sur la modélisation en UML. | |
- | ====== Cards ====== | + | * Mettre en oeuvre les principes GRASP et SOLID au travers de seulement la conception. |
- | + | ||
- | One of the first problems we will tackle in this module is to design an abstraction that can conveniently represent a single playing card. In a standard deck of cards there are 52 distinct cards and any given card can be completely defined by its suit (Hearts, Spades, Diamonds, Clubs) and its rank (Ace, 2, 3,...,10, Jack, Queen, King). | + | |
- | + | ||
- | In a program we can represent a playing card in many different ways. For example, using a single integer between 0 and 51 where the value of the integer somehow represents the card. Or, we could represent a card using a combination of 6 boolean values (insane but technically possible). Here to apply the principle of information hiding, we would organize our program structure so as to hide the decision of how exactly we represent a card in the program. | + | |
- | + | ||
- | + | ||
- | we started to design this type, we would quickly realize that our program also needs to manipulate two other types of values: suits and ranks. These types of values are a bit different because they are more like labels for domain objects than actual objects. What makes them feel like labels are that there are a finite number of them for a particular type of values (e.g., 4 for suits), and it appears to be useless to have two or more instances representing a given suit (e.g., clubs). In fact values of these types would be used more or less as constants in a program. | + | |
- | <code java> | + | |
- | public enum Suit | + | |
- | { | + | |
- | CLUBS, DIAMONDS, SPADES, HEARTS | + | |
- | } | + | |
- | </ | + | |
- | TO DO | + | |
- | + | ||
- | Extend the Suit enumerated type in Card to include a method color() that returns the color of the suit. The return type should be a new enumerated type Color. | + | |
- | https:// | + | |
- | + | ||
- | + | ||
- | Extend version 7 of class Card to support the concept of a " | + | |
- | https:// | + | |
- | + | ||
- | + | ||
- | Add a method getCards() to the Deck class that returns the cards in the deck without breaking encapsulation. | + | |
- | + | ||
- | ===== Class Interactions ===== | + | |
- | https:// | + | |
- | Consider the following program: | + | |
- | <code java> | + | |
- | class Game | + | |
- | { | + | |
- | Deck aDeck; | + | |
- | ... | + | |
- | + | ||
- | public final class Deck | + | |
- | { | + | |
- | | + | |
- | ... | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | } | + | |
- | </ | + | |
- | ===== Hand class ===== | + | **Déroulé :** |
- | Design and implement a well-encapsulated abstraction to represent a " | + | * Les étudiants se mettent par deux pour pouvoir échanger. |
+ | * Ils modélisent au choix sur papier ou sur un outil de modélisation de leur choix l'application. | ||
+ | * Ils explicitent en quoi leurs choix répondent aux principes SOLID et GRASP. | ||
+ | * Ils s' | ||
+ | Ce travail fera l' | ||
- | http:// | + | **Etude de cas** |
+ | - Il existe plusieurs types de crises. Certaines sont des accidents, d' | ||
+ | - A une crise sont associées des missions. Une mission peut correspondre à plusieurs crises dans le cas où plusieurs crises doivent être simultanément gérées (//par exemple, un accident et un incendie// | ||
+ | - A la création d'une mission sont automatiquement associées les tâches idoines en attente de validation. //Par exemple, à la mission " | ||
+ | - Aux tâches sont associées des ressources. Une ressource ne peut pas être affectée à plusieurs tâches en même temps. //Par exemple, à une tâche de transport sont associés un véhicule et un chauffeur.// | ||
+ | - Une tâche peut être invalidée ou terminée. Selon les types de tâches, elles commencent/ | ||
+ | - Une ressource affectée à une mission est en permanence localisée. S'il s'agit d'un engin, la localisation est obtenue en utilisant le GPS intégré. S'il s'agit d'un être humain, la localisation est la dernière qu'il a renseigné dans le système. Il peut aussi utiliser son téléphone pour se faire localiser automatiquement. | ||
+ | - Il est possible de connaître les ressources qui sont libres. | ||
+ | - Lorsqu' | ||
+ | - Lorsqu' | ||
+ | - Pour les crises, missions et tâches terminées, il est possible de connaitre le nombre de ressources utilisées. | ||
+ | - Une ressource est considérée comme libre dès qu' | ||
+ | - La durée effective d'une tâche correspond au temps passé entre le début et la fin de la tâche. | ||
+ | - A tout moment un expert peut demander au système quelles sont les crises en cours et obtenir pour chacune la durée prévue. En sélectionnant une crise, il peut alors la visualiser. | ||
+ | - L' | ||
+ | - Un système central permet à l' | ||
- | https:// | ||
2019_2020/s3/concprogobjet/td/td3.1569170882.txt.gz · Last modified: 2019/09/22 16:48 by blay