Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top