---
# System prepended metadata

title: 'TP2 Genie Logiciel :'

---

# TP2 Genie Logiciel : 
Modélisation objet avec UML : Analyse des besoins et diagramme de classes
https://md2pdf.netlify.com/
~~~~
Alif Aizat MOHD NOOR
Licence 2 Informatique
Université de La Rochelle
01/10/2019
~~~~
### Exercice 1




-____________________________________________________________________________________-


Client.java
```java=

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GenieLog;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author alifaizat
 */
public class Client {
    
    private int id;
    private String nom;
    private String adresse;
    
    private List<HotelBooking> reserved;
    private List<Stay> order;
    private List<Stay> stay;
    private List<PlaneTicket> travel_Document;
    

    public Client(int id, String nom, String adresse) {
        
        /*
        Le code ici...
        */
    }

    public int getId() {
        return id;
    }
    
    public String getNom() {
        return nom;
    }
    
    public void setNom(String nom) {
        this.nom = nom;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public void addTravelDoc(PlaneTicket travelDoc){
        /*
        Le code ici...
        */
    }
    
    public void addHotelBooking(HotelBooking hb){
        /*
        Le code ici...
        */
    }
    
}

```
<br> 

-____________________________________________________________________________________-

RoomType.java
```java=
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GenieLog;

/**
 *
 * @author alifaizat
 */
public enum RoomType {
    SINGLE,DOUBLE,FAMILY;
}

```

-____________________________________________________________________________________-

Stay.java
```java=
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GenieLog;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author alifaizat
 */
public class Stay {
    
    private Date start;
    private Date end;
    
    private Client client;
    private List<Client> guest;
    private List<PlaneTicket> transport;
    private List<HotelBooking> reserved;

    public Stay(Date start, Date end, Client client) {
        
        /*
        Le code ici...
        */
    }

    public Date getStart() {
        return start;
    }

    public void setStart(Date start) {
        this.start = start;
    }

    public Date getEnd() {
        return end;
    }

    public void setEnd(Date end) {
        this.end = end;
    }

    public Client getClient() {
        return client;
    }

    public List<Client> getGuest() {
        return guest;
    }

    public List<PlaneTicket> getTransport() {
        return transport;
    }

    public List<HotelBooking> getReserved() {
        return reserved;
    }
    
    
    public void bookTicketTransport(String reference, Client client){
        
        /*
        Le code ici...
        */
    }
    
    public void bookHotel(Hotel hotel){
        
        /*
        Le code ici...
        */
    }
    
}
```
-____________________________________________________________________________________-

PlaneTicket.java

```java=
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GenieLog;

/**
 *
 * @author alifaizat
 */
public class PlaneTicket {
    
    private String reference;
    private Client reservation;
    private Stay origin;

    public PlaneTicket(String reference, Client resarv, Stay origin) {
        
        /*
        Le code ici...
        */
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public Client getReservation() {
        return reservation;
    }

    public void setReservation(Client reservation) {
        this.reservation = reservation;
    }

    public Stay getOrigin() {
        return origin;
    }

    public void setOrigin(Stay origin) {
        this.origin = origin;
    }
    
    
    
}

```
-____________________________________________________________________________________-

HotelBooking.java
```java=
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package GenieLog;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author alifaizat
 */
public class HotelBooking {
    
    private int noHotel;
    private Date start;
    private Date end;
    private int numNight;
    private String rec;
    private boolean isAllowedSmoking;
    
    private List<Client> reservation;
    private Stay origin; //composition

    public HotelBooking(int noHotel, Date start, Date end, int numNight, String rec, boolean isAllowedSmoking,Stay origin) {
        
        /**
         * Les code ici...
         */
    }
    
    
    
}


```

<br><br><br>

### Exercice 2 : Reverse engineering

![](https://i.imgur.com/mqD5mg4.png)
<br><br>

### Exercice 3 : Conception d’un diagramme de classes

![](https://i.imgur.com/vvDe6Ft.png)

<br><br><br><br>

lien : https://hackmd.io/@AlifAizat/BypQO2euB