Skip to content

PR for review#19

Open
SPetrenko17 wants to merge 7 commits into
masterfrom
static_generetion_develop
Open

PR for review#19
SPetrenko17 wants to merge 7 commits into
masterfrom
static_generetion_develop

Conversation

@SPetrenko17

Copy link
Copy Markdown
Collaborator

No description provided.

@SPetrenko17 SPetrenko17 requested review from leshiy1295 and removed request for leshiy1295 December 15, 2019 17:55

@leshiy1295 leshiy1295 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Неплохо используется STL
Стоит учесть все замечания, чтобы улучшить архитектуру.
Ну и опять же - здорово, что есть рабочий прототип!


#include "PageData.h"

PageData::PageData(std::vector<UserData *> u, PageType t, Organize o) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

используйте список инициализации

#include<vector>
#include <Views/UserData/UserData.h>

enum class PageType : uint8_t {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем int8_t, да ещё и unsigned?

Comment thread Sources/PageGenerator/PageGenerator.cpp Outdated
#include "PageGenerator.h"

void
PageGenerator::organizeCells(Organize o, int &rows, int &cells, int count) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не нужно использовать однобуквенные переменные

Comment thread Sources/PageGenerator/PageGenerator.cpp Outdated
rows = count;
break;

case Organize::RECT_HORIZONTAL:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что с этими вариантами?

Comment thread Sources/PageGenerator/PageGenerator.cpp Outdated
void
PageGenerator::organizeCells(Organize o, int &rows, int &cells, int count) {
switch (o) {
case Organize::ONE_LINE_VERTICAL:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стоило вынести в стратегию и реализовать в виде цепочки ответственности/подмешивания policy для конкретного класса

}

void CellView::destroy() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что здесь должно происходить?
почему этот метод не вызывается хотя бы в деструкторе?


void destroy() override;

std::string toString(int depth) override;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

вывод и иерархия - вообще-то разные вещи
можно задавать string-методы с помощью примеси (применив паттерн CRTP)

case BClass::LIST_ITEM:
return "list-group-item";

case BClass::TABLE :

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кажется, что лучше, если каждый класс эту информацию будет знать про себя сам
иначе этот файл (а он интерфейсный) будет постоянно расширяться...

std::make_shared<RowView>(*new RowView(0,
*new TextView(
"ageView",
Type::H4,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

снова магические строки...

}


void PersonView::makeTemplate(){

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стоило бы шаблон задавать реальным файлом извне, чтобы его мог задавать пользователь без необходимости лезть в исходный код

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants