Skip to content

Домашняя работа по паттернам#6

Closed
nazarovNV wants to merge 38 commits intoAndroid-Developer-Basic:masterfrom
nazarovNV:master
Closed

Домашняя работа по паттернам#6
nazarovNV wants to merge 38 commits intoAndroid-Developer-Basic:masterfrom
nazarovNV:master

Conversation

@nazarovNV
Copy link

No description provided.

override fun toString(): String {
return "User(name=$name, age=$age, email=$email)"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nazarovNV, тут вы немного ошиблись в аналогии.
Строитель строит дом, а не самого себя.

  1. Вы даете строителю ТЗ (2 этажа, цвет - красный, крыша - черепица)
  2. Говорите: "строить"
    В результате получаете дом.
    У вас - строитель строит сам себя, а не User.
    Добавьте метод build, который создаст пользователся с заданными свойствами

ScreenManager.showScreen(mainScreen)
ScreenManager.transition()
ScreenManager.showScreen(authScreen)
ScreenManager.transition()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@nazarovNV, тут и да и нет :)
Вы правы, что в котлине object - это встроенная реализация синглтона.
Но для понимания, напишите, пожалуйста, классику - со всеми этими getInstance и приватным конструктором :)

@nazarovNV
Copy link
Author

Поправил билдер и синглтон

Lofter23rus added a commit to Lofter23rus/homework_kotlin6_ab2409_lofter that referenced this pull request Jan 5, 2025
@motorro motorro closed this Aug 22, 2025
mahonin-ms pushed a commit to mahonin-ms/homework05 that referenced this pull request Sep 30, 2025
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