Главная | Обратная связь | Поможем написать вашу работу!
МегаЛекции

Диаграмма последовательностей




Продавец-консультант: Даёт консультацию клиенту, проверяет его лицензию и продаёт товар

Клиент: Покупает товар, если требования товара соответствуют его возможностям (цена – деньги, необходимость лицензии – наличие лицензии).

Складной работник: Проверяет наличие товара, и, при его наличии, может принести его покупателю.

Товар: Проверяется на необходимость лицензии и получается его цена

Прототип кода, сгенерированный в Enterprise Architect.

///////////////////////////////////////////////////////////

// Director.h

// Implementation of the Class Director

// Created on: 30-дек-2013 0:47:38

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_08383C4C_0882_48ba_8EEF_587C2809F8C6__INCLUDED_)

#define EA_08383C4C_0882_48ba_8EEF_587C2809F8C6__INCLUDED_

 

#include "Human.h"

#include "Worker.h"

 

class Director: public Human

{

 

public:

Director();

virtual ~Director();

Worker *m_Worker;

 

void FireCrew(Worker* crew);

int GetLoyality();

void HireCrew(Worker* crew);

void PaySalaryToAll();

void SetLoyality(int newL);

 

private:

int loyality;

 

};

#endif //!defined(EA_08383C4C_0882_48ba_8EEF_587C2809F8C6__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Car_Store.h

// Implementation of the Class Car_Store

// Created on: 30-дек-2013 0:47:37

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_22CF115C_31BB_4644_A0EF_7ADC2ED156CA__INCLUDED_)

#define EA_22CF115C_31BB_4644_A0EF_7ADC2ED156CA__INCLUDED_

 

#include "Director.h"

#include "Good.h"

 

class Car_Store

{

 

public:

Car_Store();

virtual ~Car_Store();

Director *m_Director;

Good *m_Good;

 

void SetOpenCloseStatus(short curTime);

 

private:

bool opened;

short TimeClose;

short TimeOpen;

 

};

#endif //!defined(EA_22CF115C_31BB_4644_A0EF_7ADC2ED156CA__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Security.h

// Implementation of the Class Security

// Created on: 30-дек-2013 0:47:39

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_5DB156E5_A923_4d1e_B6B2_FB08D87B287E__INCLUDED_)

#define EA_5DB156E5_A923_4d1e_B6B2_FB08D87B287E__INCLUDED_

 

#include "Worker.h"

 

class Security: public Worker

{

 

public:

Security();

virtual ~Security();

 

void Protect();

 

};

#endif //!defined(EA_5DB156E5_A923_4d1e_B6B2_FB08D87B287E__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Client.h

// Implementation of the Class Client

// Created on: 30-дек-2013 0:47:38

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_C8020F69_3F2C_41ab_82BD_29DBC8EB4195__INCLUDED_)

#define EA_C8020F69_3F2C_41ab_82BD_29DBC8EB4195__INCLUDED_

 

#include "Human.h"

 

class Client: public Human

{

 

public:

Client();

virtual ~Client();

 

void Buy(Good* weap);

bool CanBuy();

int GetMoney();

 

private:

bool haveDrivers_License;

int Money;

 

};

#endif //!defined(EA_C8020F69_3F2C_41ab_82BD_29DBC8EB4195__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Shopper.h

// Implementation of the Class Shopper

// Created on: 30-дек-2013 0:47:39

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_C1F92F79_A0AB_457a_A673_3761B3673A7C__INCLUDED_)

#define EA_C1F92F79_A0AB_457a_A673_3761B3673A7C__INCLUDED_

 

#include "Worker.h"

 

class Shopper: public Worker

{

 

public:

Shopper();

virtual ~Shopper();

 

void GetConsultation();

void Sell(Good* ammo);

 

private:

bool CheckClientLicense();

 

};

#endif //!defined(EA_C1F92F79_A0AB_457a_A673_3761B3673A7C__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Worker.h

// Implementation of the Class Worker

// Created on: 30-дек-2013 0:47:40

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_FFEF281D_C1F9_469e_9530_B254C313C06F__INCLUDED_)

#define EA_FFEF281D_C1F9_469e_9530_B254C313C06F__INCLUDED_

 

#include "Human.h"

 

class Worker: public Human

{

 

public:

Worker();

virtual ~Worker();

 

void CalculateNewSalary();

virtual void GetShedule(boolean* shed);

virtual void PaySalary();

 

protected:

int salary;

boolean[7] shedule;

 

};

#endif //!defined(EA_FFEF281D_C1F9_469e_9530_B254C313C06F__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Store_worker.h

// Implementation of the Class Store_worker

// Created on: 30-дек-2013 0:47:40

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_D1E9836F_4438_4d5c_8BCC_41D09FBAE858__INCLUDED_)

#define EA_D1E9836F_4438_4d5c_8BCC_41D09FBAE858__INCLUDED_

 

#include "Worker.h"

 

class Store_worker: public Worker

{

 

public:

Store_worker();

virtual ~Store_worker();

 

boolean CheckForDeficit();

boolean CheckWeapon(Good* weap);

void GiveWeapFromStore(Good* weap);

 

};

#endif //!defined(EA_D1E9836F_4438_4d5c_8BCC_41D09FBAE858__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Good.h

// Implementation of the Class Good

// Created on: 30-дек-2013 0:47:38

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_F3F07291_D763_463e_9B24_7DCC1F347208__INCLUDED_)

#define EA_F3F07291_D763_463e_9B24_7DCC1F347208__INCLUDED_

 

class Good

{

 

public:

Good();

virtual ~Good();

 

bool CheckForLicense();

void GetName(char* nm);

int GetPrice();

 

private:

char* name;

bool needLicense;

int price;

 

};

#endif //!defined(EA_F3F07291_D763_463e_9B24_7DCC1F347208__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Cleaner.h

// Implementation of the Class Cleaner

// Created on: 30-дек-2013 0:47:37

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_AAFBE8A1_681B_44df_A23E_20AFC750EA37__INCLUDED_)

#define EA_AAFBE8A1_681B_44df_A23E_20AFC750EA37__INCLUDED_

 

#include "Worker.h"

 

class Cleaner: public Worker

{

 

public:

Cleaner();

virtual ~Cleaner();

 

void Clean();

 

};

#endif //!defined(EA_AAFBE8A1_681B_44df_A23E_20AFC750EA37__INCLUDED_)

 

///////////////////////////////////////////////////////////

// Human.h

// Implementation of the Class Human

// Created on: 30-дек-2013 0:47:39

// Original author: Андрей

///////////////////////////////////////////////////////////

 

#if!defined(EA_E4848DDB_CD86_4481_8AB5_16F78234679D__INCLUDED_)

#define EA_E4848DDB_CD86_4481_8AB5_16F78234679D__INCLUDED_

 

class Human

{

 

public:

Human();

virtual ~Human();

 

virtual int GetExpierence();

void GetInfo(char* cSex, char* cSurname, char* cName, int* iExp, int* iAge);

 

protected:

int Age;

int exp;

char* Name;

char sex;

char* Surname;

 

};

#endif //!defined(EA_E4848DDB_CD86_4481_8AB5_16F78234679D__INCLUDED_)

 

Поделиться:





Воспользуйтесь поиском по сайту:



©2015 - 2024 megalektsii.ru Все авторские права принадлежат авторам лекционных материалов. Обратная связь с нами...