Session Façade in a Client-Server Application

In the J2EE Pattern Session Façade - that the "Core J2EE Patterns - Best Practices and Design Strategies" book says:

Use a Session Façade to encapsulate business-tier components and expose a coarse-grained service to remote clients. Clients access a Session Façade instead of accessing business components directly.

I want to know what it means with remote clients? Cause i'm creating a client server application where the client is an android app and the server is a java server. Is Session Façade what i need to expose to the client (the android app) the API that is necessary for the communication between them two?

Thanks.

Answers


A remote client can be anything - Web Browser, Android App or some other web service or applications.

Now when you provide a Facade. It will expose you the interface that your Android App (Remote Client) will use to access the server side. In this way, your android app don't have to worry about the implementation details of business logic and data processing.

Your logic for accessing and processing data may change over time but as long as your Facade Interface is same you client won't have to worry about anything, which is the benefit of facade. Moreover if tomorrow if you want to develop the app in windows or iPhone you can use the same Facade interface to access your system w/o writing a single new line of code.


Facade should provide simplified interface for server client comunication (session). So this service (facade) should agregate all important methods for this communication.

You can look at design patern facade to read more.


Need Your Help

Ignore "Cannot resolve symbol" in Resharper

c# resharper

Say I have a method signature like this:

Removal of whitespace and text in brackets - make my working code more elegant

regex python-2.7 replace brackets

I wrote a code to remove all parentheses in a txt file, and the text between them, as well as multiple whitespace.