-
Notifications
You must be signed in to change notification settings - Fork 1
Singleton
You a familiar with the singleton pattern. It should be handled with care. It has the tendency to shift an object oriented program into a mess similar to good old C programs.
It has its advantages, though. Take this section as thoughts and a rule of thumb but not as strong rule. You follow your way.
You have to implement a GUI for your application logic. GUI code is split into two major parts: Layouts, menus etc. are defined in resources. Activities glue user actions and application logic together.
You activities will always need access to your components. How to get them?
Singleton pattern seams useful in this scenario. We defined a class SharkNetApp. This class represents the whole Android application.
It provides a initializeSharkNetApp
method.