Search code examples
c#.net3-tier

How to access view from logic layer?


I am trying to make an ATM Application in .NET Framework using C#. I have implemented some part of it using 3 tier architecture.

As the user chooses to withdraw cash, flow moves from VIEW to LogicLayer as I have added reference of VIEW in LogicLayer. Now I need to call a method of view from LogicLayer. Can some one tell me how to do that?

Thanks

class DataAccessLayerClass
{
    BusinessObjectClass read(BusinessObjectClass bo)
    {
        //read from file if user exists then return his credentials

        //else
        //call INVALID USERNAME / PASSWORD errror method in VIEW. 
    }
}

I can flow from VIEW to LL and DAl, but how to flow in reverse direction? As desired in this case


Solution

  • Do not try to use functionalities of view on the business layer. This is the destruction of your application structure. You have to think just one way connection. Not a dialog. For example: View can call logic layer and returns a result. Then AGAIN view calls logic according to result.