Skip to content

Instantly share code, notes, and snippets.

@pjastr
Created March 30, 2020 14:08
Show Gist options
  • Save pjastr/9ceff1b5c7b1a70e28419518e02a0d2d to your computer and use it in GitHub Desktop.
Save pjastr/9ceff1b5c7b1a70e28419518e02a0d2d to your computer and use it in GitHub Desktop.

E1. Stwórz klasę Telefon z polami marka typu string oraz model typu int. Następnie zaimplementuj wzorzec prototypu/głębokiej kopii. Stwórz przypadek testowy.

E2. Na podstawie diagramu UML stwórz projekt. Następnie zaimplementuj wzorzec prototypu/głębokiej kopii. Stwórz co najmniej jeden przypadek testowy.

E3. Przeanalizuj przykłady dostępne na stronie https://refactoring.guru/design-patterns/singleton/csharp/example#example-1 Na podstawie tego przygotuj projekt z dwoma wersjami wzorca Singleton (z obsługą wątków i bez).

E4. Zmodyfikuj wzorzec singletonu tak, aby dopuszczał maksymalnie dwie instancje obiektów danego typu.

(*) czy jest możliwe aby były dokładnie dwie instancje albo zero?

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