0% ont trouvé ce document utile (0 vote)
5 vues3 pages

Agenda électronique et tranches horaires

Transféré par

tahaelaya
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
5 vues3 pages

Agenda électronique et tranches horaires

Transféré par

tahaelaya
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF, TXT ou lisez en ligne sur Scribd

Rappel Java

Agenda électronique

Agenda

0..*
1 1
Activite TrancheHoraire

1 1

1 1
Cours Reunion Date

L’application à réaliser est un agenda électronique simplifié. Cet agenda stocke un certain
nombre d’activités qui sont caractérisées par un but (une chaîne de caractères) et une
tranche horaire prévue pour la réalisation de celles-ci. Une spécialisation des activités à
l’aide d’héritage qui sont les cours et les réunions.
La définition d’une tranche horaire se fait par la détermination d’une date de débute et
d’une date de fin. La durée d’une tranche horaire est calculée automatiquement. La date
représentée dans le système tient compte d’année, mois, jour, heure et minute.
• Un certain nombre de contraintes :
• Une tranche ne peut exister qu’au sien de la même journée.
• La date de début d’une tranche est nécessairement inférieure à sa date de fin.
• L’agenda ne peut stocker deux activités dont les tranches horaires se chevauchent.

è La classe Date Date


- minute : int
avant(Date d) : vérifiée si la date est avant la date d - heure : int
apres(Date d) : vérifiée si la date est après la date d - jour : int
identique(Date d) : vérifiée si la date est identique que la date d - mois : int
memeJour(Date d) : vérifiée si la date a le même jour que la date d - année : int
+ getMinute : int
1. Crée la classe Date puis une instance de cette classe + getHeure() : int
2. Réaliser l’affichage de la date + getJour() : int
3. Crée une seconde instance pour tester les autres méthodes + getMois() : int
+ getAnnee() : int
+ toString() : String
+ identique(Date) : boolean
+ memeJour(Date) : boolean
+ avant(Date) : boolean
+ apres(Date) : boolean

Pr. Youness TABII


è La classe TrancheHoraire

chevauche(TrancheHoraire th) : vérifiée si les tranche TrancheHoraire


horaire se chevauche ou pas. - dateDebut : Date
duree doit être en minute
- dateFin : Date
- duree : int
1. Crée une instance de cette classe
+ getDateDebut(): Date
2. Tester les autres méthodes
+ getDateFin() : Date
+ getDuree() : int
+ chevauche(TranchHoraire) : boolean

è La classe Activite
Activite
1. Crée une instance de la classe Activite
- but : String
2. Tester les autres méthodes - trancheHoraire : TrancheHoraire
+ getBut: Date
+ get trancheHoraire() : TrancheHoraire
+ toString() : String

è La classe Agenda

1. Créer une instance de la classe Agenda, tester Agenda


2. Créer plusieurs activités, insérer ces activités dans l’agenda
- contenu : Vector
3. Réaliser l’affichage du contenu de l’agenda
+ ajouterActivite(Activite)
4. Tester les contraintes liées au chevauchement des tranches
+ suprimeActivite(Activite)
horaires des activités
+ afficheContenu()

è La classe Cours
Cours
Un cours est caractérisé par un lieu, un professeur est une matière - lieu : String
enseigné.
- professeur : String
1. Ecrire la classe Cours - matiere : String
2. Ecrire le constructeur
+ getLieu() : String
3. Ecrire les méthodes nécessaires
+ getProfesseur() : String
4. Créer une instance de la classe Cours, tester dans l’agenda
+ getMatiere() : String
+ toString() : String

Pr. Youness TABII


è La classe Reunion

1. Ecrire la classe Reunion Reunion


2. Ecrire le constructeur - lieu : String
3. Ecrire les méthodes nécessaires
- initiateur : String
4. Créer une instance de la classe Reunion, tester dans - participants : Vector
l’agenda
+ getLieu() : String
+ getInitiateur() : String
+ getParticipants() : String
+ ajouterParticipant(personne : String)
+ toString() : String

Pr. Youness TABII

Common questions

Alimenté par l’IA

The application handles the display of the agenda's content through the `afficheContenu()` method in the Agenda class, which outputs the stored activities. Management of these activities is facilitated by methods such as `ajouterActivite(Activite)` to add, and `suprimeActivite(Activite)` to remove activities, ensuring seamless modifications and updates to the agenda's content .

The application manages scheduling conflicts by utilizing the `chevauche(TrancheHoraire th)` method in the TrancheHoraire class, which checks for and prevents overlapping time slots. This mechanism, along with the agenda's constraint of non-overlapping activities on a single day, ensures efficient scheduling operations by immediately identifying and resolving potential conflicts before activities are added .

To test whether two instances of the Date class represent identical days, one should utilize the `memeJour(Date d)` method. This method compares the day, month, and year attributes of the two date instances, confirming whether they refer to the same calendar day, thus verifying their equality in terms of day representation .

The Reunion class expands the agenda's functionality by allowing the scheduling and management of meetings, characterized by attributes like location ('lieu'), initiator ('initiateur'), and participants (a vector of individuals). These attributes enable the agenda to handle meetings' logistics, participant management, and provide detailed information essential for organizing successful events .

Inheritance and specialization enhance the application's functionality by allowing the base class Activite to be extended into more specialized classes like Cours and Reunion. This enables shared attributes and methods to be inherited, reducing redundancy while allowing specific features and methods to be added to each specialized class. This design ensures a scalable and maintainable system architecture, facilitating the distinction of activities like courses and meetings with their unique attributes .

The application implements strategies for correctness in date manipulations and comparisons by employing the Date class's methods such as `avant(Date d)`, `apres(Date d)`, and `identique(Date d)` to accurately assess temporal relationships. These methods ensure that time slots are logically consistent and correctly processed within the system's constraints, such as non-overlapping activities on the same day .

The Cours class is a specialization of an activity in the agenda application that represents academic classes. It is characterized by attributes such as location ('lieu'), the professor ('professeur'), and the subject taught ('matiere'). These attributes provide the necessary information to manage and display courses within the electronic agenda .

The electronic agenda application ensures no overlapping activities are scheduled by enforcing a constraint in the TrancheHoraire class, which uses the `chevauche(TrancheHoraire th)` method to verify if two time slots overlap. This is complemented by a system constraint that activities in the agenda cannot have overlapping time slots for the same day .

The Date class in the electronic agenda application provides the foundation for defining time slots with detailed attributes such as minute, hour, day, month, and year. It includes methods like `avant(Date d)` and `apres(Date d)` to compare dates. Time duration is automatically calculated within the TrancheHoraire class by determining the difference between start and end times .

Creating an instance of the TrancheHoraire class involves instantiating it with a start and end date, represented by the Date class objects. To verify if it overlaps with another instance, the `chevauche(TrancheHoraire th)` method is used. This method checks time overlaps between the two instances, ensuring they do not interfere with each other's predefined time slots .

Vous aimerez peut-être aussi