4

http://developer.android.com/guide/basics/what-is-android.html See Android Architecture.

Can we consider different managers like facade objects for different subsystems. For example,can we consider Resource Manager like a facade object to all resources subsystem?

Or maybe managers name for classes have different purposes?

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
user1074896
  • 1,025
  • 2
  • 15
  • 27

2 Answers2

5

I would say this should be distinguished on case by case basis, and the answer will often be "no". Let me explain why.

The gang of four defined facade as a specific entry point to some system which doesn't have any functionality on its own, but provides a simple interface to the subsystem without removing the access to that subsystem.

Now, let's have a look at, for example, android.content.res.Resources. It really is a unified interface, but can we get the resources without using it? No, it's not possible: it uses methods of android.content.res.AssetManager which are not available to the programmer. Therefore Resources does not really simplify access to something else, this class is an inseparable part of the resources system. This means that this class can't be considered a facade.

A class like android.view.animation.AnimationUtils, on the contrary, is a facade. It doesn't do anything a developer couldn't do himself. However, instead of parsing XML files and creating animation classes manually it is easier for a developer to call one of the methods of this class. It represents some default uses of the animation subsystem without removing the access to the system itself. Therefore, it has the full right to be called a facade.

Malcolm
  • 41,014
  • 11
  • 68
  • 91
  • Does managers classes have purpose to introduce a single point of access to some subsystems? – user1074896 Feb 21 '12 at 11:48
  • @user1074896 It depends on what we consider a manager. Some of the classes provide a single entry point like `AlarmManager`, but `PreferenceManager`, for example, doesn't. – Malcolm Feb 21 '12 at 14:03
2

You reflect in right direction, I think. For example there are some XXXManager classes in Android Framework which allows you to work with specified system: preference system, search system, application packages system and etc.

And we may to perceive all of this class like Facades. Another hand they provide more concrete objetcs which we should use to make changes in the system.

teoREtik
  • 7,886
  • 15
  • 46
  • 65