Home  /  Questions  /  Question



73   96.1
Sep 19, 2010


Facade missing in 4.0 - why?

Hi,

The comments in Desing Pattern Framework 4.0 refers to CustomerFacade in multiple places but Facade is not present in the solution. It was present in the 2.0 version and later removed from 3.5 & 4.0.

In my opinion, Facade is a good Design Pattern as it was hiding the logic for business object & data access layer from the service layer. In the current version, the service layer directly interacts with the DAL through various DAO implementations.

Please suggest the reason for not using Facade layer and whether it is advisable to directly access DAO bypassing the business layer?



830   99.9
Sep 23, 2010
Actually the Facade is very much present in Design Pattern Framework.   The Service class, which represents the Service Layer is the main Facade in the application. It really is a great example of the Facade Pattern in action.

As you said, the Facade is an important pattern.

73   96.1
Sep 27, 2010
Hi Dan
Thanks for your answer. It seems the service layer is now the facade to the application. That sounds good - however I have another question. Is it good to access the DAL directly from the service layer or through the business layer? In .NET 2.0 PIA the service layer acted just as a very passive layer by just sending the request to business layer (through business facades) whereas in 4.0 PIA it is directly calling the DAL.

What is the preferred approach - accessing DAL directly through Service layer or through Business layer?

Regards
Sanjay