This project concerns the practice of object-oriented design. It is divided into 3 parts (3 versions) and allows to implement the addition of new functionality on an existing base by using various concepts such as (abstraction, design patterns). It also concerns the pratice of clean code and sofware testing and team work.
- Aboubacar DIAWARA
- Abdoulkader MOUSSA MOHAMED
click here to see the progress and the design.
-
you can directly download it graphicaly.
-
you can also use git commands to clone it.
$ git clone <clone_link> # clone_link is hhtps or ssh link of the git repository
$ make compile # compile on ly the source code
Tests check if the application works correctly.
To generate the tests classes, follow the next instructions:
WARNING: to compile test classes, you should be sure the class ounder testing (files in src/competition) have already been compiled. Otherwise we doubt it will work (except by miracle).
$ make testCompile # compile only the test classes, be sure to have already done the previous step
$ make # compile both (tests) and (code under test) but also the jar (see bollow).
$ make runTest # run all the test classes
If you want to read about using the programm, the ressource should be generated manually.
Follow the instructions bellow.
- Open the project.
- Then use the makefile commands to generate the
documentations
.
$ make doc
- Then use this commande to open it on the navigator.
$ xdg-open ./docs/index.html
You should notice a new non-empty directory docs
in the root of the project.
jar file is an executable based on zip file format, in the section we'll see how to generate it
before this step, make sure you have already create the executables.
To generate the jar
file, follow the following instructions.
- Go in the root of the project.
- Then execute the command:
$ make jar
You should notice a new files Master.jar
League.jar
Tournament.jar
in the root.
You can now execute it !!!!
$ java -jar Tournament.jar
$ java -jar League.jar
$ java -jar Master.jar # this command will show the usage of the MasterCompetition
Try the following command to run an exemple of Master competition.
$ java -jar Master.java 3 losc pasg marseille lyon
Or this one with another Competition rule.
$ java -jar Master.jar 2 psg nantes marseille nice lyon reines lens ajaccio Troyes toulouse sochaux valencienne rennes reins nimes calais strasbourg limoge Dijon montpellier brest lorient clermont toulon
- Le Pattern Builder: Au fil des modifications, la construction des competitions mobilisait beacoup d'objets, qui n'etaient pas toujours imperatifs. Nous avons donc utiliser le pattern builder pour pallier le problème de construction.
- Pattern Strategy: Chaque competition de type master etait sujette à une règle (finaliste d'une poule, nombre de competiteurs). Nous nous sommes inspirer du pattern strategy pour implementer les reglements. Ainsi ils pourront facilemet etre interchangés
- Template method: toujours dans le but de saligner au mieux à l'un des principes fondamentaux d'une bonne concption orienté objet (programme ouvert à l'extenxion et fermé à la modification) nous avons utilisé ce patron partout où besoin fut.
- Patron observateur: patron utilisé pour l'implementation de la fonctionnalité des journalistes et des bookmakers.
- ...
Aussi nous avons adopté une approche TDD qui consistait à implementer dans un premier temps les tests puis ecrire le programme proprement dit en se servant du test comme validateur