Skip to content

Instantly share code, notes, and snippets.

@MarionLeHerisson
Last active March 9, 2020 15:12
Show Gist options
  • Save MarionLeHerisson/d0c8a06a0136abcf25c7c54285b2fa7b to your computer and use it in GitHub Desktop.
Save MarionLeHerisson/d0c8a06a0136abcf25c7c54285b2fa7b to your computer and use it in GitHub Desktop.
Software architecture heuristics - Exercice 1 : modélisation
class Product {
int $id;
string $name;
function isAvailable(): bool
{
}
}
class Customer {
int $id;
string $email;
string $fullName;
int $phoneNumber;
bool $didBuySomething = false;
function register(string $email, string $fullName, string $address, int $phoneNumber)
{
}
function buy(Product $product)
{
$this->didBuySoething = true;
new Order($product, $this, $shippingAddress);
}
}
class Professional extends Customer {
string $billingAddress;
function register(string $email, string $fullName, string $address, int $phoneNumber, string $billingAddress)
{
}
}
class MarketingPeople {
int $id;
function getCustomersToContact(): Customer[]
{
}
}
class PostOffice {
int $id;
string $address;
Order[] $orders;
function notifyCustomerOfArrival(Customer $customer)
{
}
}
class Order {
int $id;
Product $product;
Customer $customer;
string $address;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment