Sollicitatievraag bij Philips

Design patterns--factory,observer

Antwoord op sollicitatievraag

Anoniem

4 sep 2018

factory - In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. --------------------- Creational patterns: Builder (e.g. AlertDialog.Builder) Dependency Injection (e.g. Dagger 2) Singleton Structural patterns: Adapter (e.g. RecyclerView.Adapter) Facade (e.g. Retrofit) Behavioral patterns: Command (e.g. EventBus) Observer (e.g. RxAndroid) Model View Controller Model View ViewModel (similar to the MVC pattern above) ---------------------- Observer - The Observer Pattern is a software design pattern that establishes a one-to-many dependency between objects. Anytime the state of one of the objects (the "subject" or "observable") changes, all of the other objects ("observers") that depend on it are notified. -----