Windows forms layered application architecture? RRS feed

  • Question

  • I am in the process of coming up with a business application that can run on Windows as a stand alone and can also connect to a server and work in a connected mode.

    I am trying to come up with an optimum architecture. This is what I have in layers

    1. Windows Forms for the presentation

    2. Business Model with a Facade front

    3. Data access layer

    Screen Objects flow from the UI to the Business Model, container objects flow from the Business Layer to the Data Layer. The presentation layer supports asynchronous calls to the business layer and is updated accordingly. Is this an overkill? Or should I let the Forms to talk to the Business Objects directly and send them to the Data access layer?

    All this exists on the client workstation as a fat client. The Data access layer in the fat client can either talk to a local database or a remote database.



    Monday, October 2, 2006 5:00 PM

All replies

  • I started out doing plain client/server as you describe, in which all the code ran on the client including business logic and data-access, and came to the following conclusion.  I assume you will open the sql port on the server and allow the client to execute queries across the network.  I think this is a mistake.  You should use remoting or at least a web-service for this type of communication.  The app will scale much better and you may even see a performance increase.  Plus there will be far fewer database connections.   ADO.NET transations will execute much faster resulting in less locking of tables.    Other benefits are that you can keep all the business logic and data acecss code on the server and only have to deploy that part of the app in one place.  It's a bit of work, to de-couple the client from the BLL, but I think it's worth it.

    You can still keep the local / remote database feature - just keep the URI of the service configurable.

    So you will really need a layer between your 1 and 2.

    hope that helps...

    Wednesday, October 4, 2006 2:51 PM