This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// как известно, | |
// основная задача проектирования при объектной декомпозиции - это выполнение двух условий. | |
// условия удачной объектной декомпозиции: | |
// - высокое сцепление (high cohesion): максимизация связей внутри классов | |
// - низкая связанность (low coupling): минимизация (ослабление, гибкость) связей между классами | |
// ДЗ на весенние каникулы: | |
// 1) отдохнуть, набраться сил :) | |
// 2) выполнить объектную декомпозицию по отношению к классу Student (код представлен ниже) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Product | |
{ | |
// ... | |
}; | |
class Order // работа с заказом | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <curl/curl.h> | |
#include <string> | |
using namespace std; | |
/* | |
1) заходим на https://github.com/microsoft/vcpkg | |
2) качаем архив (code > download) | |
3) распаковываем архив, переносим файлы в C:\vcpkg | |
4) запускаем bootstrap-vcpkg.bat, в папке сформируется vcpkg.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLIENT SIDE: | |
#include <iostream> | |
#include <winsock2.h> | |
using namespace std; | |
#pragma comment(lib,"ws2_32.lib") | |
#pragma warning(disable:4996) | |
#define SERVER "127.0.0.1" // or "localhost" - ip address of UDP server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
__interface IService { | |
void ProvideService(); | |
}; | |
class Police : public IService { | |
// ... | |
void ProvideService() override { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Product | |
{ | |
// ... | |
}; | |
class Order // работа с заказом | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Cat { | |
string name; // кличка кота | |
string breed; // порода | |
int age; // возраст в годах | |
double weight; // вес | |
bool hungry = true; // голодный или нет? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
struct Date { | |
int day; | |
int month; | |
int year; | |
}; | |
class Person { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <windows.h> | |
using namespace std; | |
class Dog { | |
public: | |
char* name; // 8 (если архитектура х64) | |
int age; // 4 | |
void Guard() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Student { | |
char* firstname; // имя студента | |
int firstname_length; // сколько символов в имени | |
char* surname; // фамилия студента | |
int surname_length; // сколько символов в фамилии | |
char* lastname; // отчество студента | |
int lastname_length; // сколько символов в отчестве | |
char* country; // страна | |
int country_length; | |
char* region; // область |
NewerOlder