Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DialogContext -- Konstruktor statt statische Methode für neue Instanz #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruderphilipp
Copy link
Contributor

Im Zuge meiner Einarbeitung in den Code sind mir einige Dinge aufgefallen. Dieser Pullrequest konzentriert sich auf die Methode DialogContext.create.

Laut Historie in Git kam die Klasse DialogContext mit Commit 500f075 und hatte dort bereits die statische Methode create sowie einen privaten Konstruktur ohne Parameter, der dadurch gekapselt wird. Jedoch ruft create ausschließlich der Konstruktur auf und setzt die übergebenen Parameter in der neu erzeugten Objektinstanz. Es existiert keine zusätzliche Logik (z.B. Singleton o.ä.), wodurch diese Indirektion notwendig wäre.

Aus diesem Grund schlage ich hiermit vor, stattdessen einen regulären Konstruktur zu verwenden.

@ruderphilipp ruderphilipp changed the title Refactoring (in DialogContext): Nutze Konstruktor statt statischer … Nutze Konstruktor statt statischer Methode in DialogContext Jan 22, 2022
@ruderphilipp ruderphilipp changed the title Nutze Konstruktor statt statischer Methode in DialogContext DialogContext -- Konstruktor statt statische Methode für neue Instanz Jan 22, 2022
…Methode, die dann nur K'tor aufruft

Laut Historie in Git kam die Klasse `DialogContext` mit Commit
500f075 und hatte dort bereits die statische
Methode `create` sowie einen privaten Konstruktur ohne Parameter, der dadurch
gekapselt wird.

Jedoch ruft `create` ausschließlich der Konstruktur auf und setzt die
übergebenen Parameter in der neu erzeugten Objektinstanz. Es existiert keine
zusätzliche Logik (z.B. Singleton o.ä.), wodurch diese Indirektion notwendig
wäre.
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.

1 participant