Best Example for facade is a Telephone operator or a receptionist. Its responsible for routing of the operation. Facade also means entry point.
Example:Business Operations For me might be ClaimTransaction,EstimateTransation,BillingTransaction. So the business methods for my application will look like this.
In Facade Class:
---------------------------------------------------------------------------------
Function ClaimsTransaction(ByVal Operation As BusinessOperation, ByVal Input As Object, ByVal Output As Object)
Function UserTransaction(ByVal Operation As BusinessOperation, ByVal Input As Object, ByVal Output As Object)
Function AppSetUpTransaction(ByVal Operation As BusinessOperation, ByVal Input As Object, ByVal Output As Object)
Public Enum BusinessOperation
- Add
- Update
- Delete
- List
- Validate
- GetDetails
End Enum
Select Case [Operation]
Case BusinessOperation.Add
Dim claim As Claims = New Claims() --This will call respective Business operations
claim.Add()
Case BusinessOperation.List
Dim claim As Claims = New Claims()
Return claim.GetList()
Case BusinessOperation.Update
Dim claim As Claims = New Claims()
claim.Update()
End Select
---------------------------------------------------------------------------------
My Call to the Facade will be of this sort:
Dim BL As BusinessLayer.BusinessFacade = New BusinessLayer.BusinessFacade() BL.ClaimsTransaction(BusinessOperation.List, Nothing, Nothing)
----------------------------------------------------------------
No comments:
Post a Comment