locked
Client Server Programing RRS feed

  • Question

  • Hi Experts, 

    I'm now trying to develop small application but using client server architecture like erp software where there is one server one application server and many gui or presentation layer. But i dont really understand how to doit, after searching i found that i need to implement MVC or socket programming, my question is what is the different between those two and which one will help me in achieving my goal? thanks

    Regards

    Saturday, April 16, 2011 3:06 PM

All replies

  • I think it might be worth another look at architecture concepts. To say you need MVC or Sockets doesn't really make sense, maybe if you expand on that it will?
    http://pauliom.wordpress.com
    Sunday, April 17, 2011 8:22 AM
  • I think you have probably misunderstood something along the way.

     

    If you're writing something that works for a business inside it's firewall on a local network then you can just connect to the database server.

    If you're writing a web application such as asp.net webforms the web server would usually be inside a business' firewall and able to connect to the database server.  MVC is a sort of subset of asp.net.

    If you're writing something that runs on a client or server outside the firewall then you need some way to connect to the database across the firewall.  This would usually be handled by web services and I would recommend WCF.

    With any sort of application having many users the load on a database server can be quite high.  Database servers are quite expensive and the worst sort of server to have problems with so reducing load on them is a good thing.  Often there are many more reads than writes of data.  In that sort of scenario a business server ( or several ) becomes very useful because they can be much cheaper machines and you can offload some of the work to these - most often caching data so reads don't even touch the database server.

    There's a load more to this and I would suggest you're best reading up some more.

    Sunday, April 17, 2011 10:49 AM
  • Hi All, Thanks for the replay.

    Yes of course i'll need to read more about the concepts (thanks for the link).

    I already made the application (desktop application), simple application of employee master data. I'm using sql database and GUI (vb.net). The things is i wrote all the logic in the gui, for example my gui would validate the data, calculate it and store it in database. But then i read about client server programing, and i notice that gui in the client server programing doesn't contain logic (only minor validation). Gui would only send raw data and command to the application server, application server would process it and save to the data base. That is what i'm trying to achieve but i have no idea where to start, i dont understand how can the gui send data and command to other program (application server). I hope i explain my self clear. Thank you once again.

    Best Regards, Salimz

    Monday, April 18, 2011 3:23 AM
  • I'd expect most validation to take place on the client.

    But setting that aside.

    With an intermediate server of some sort there are several methods of communcating between the client and the server.

    Essentialy though, there's usually a service on the server and the client calls some method on it or places some data which the service picks up.

    I recommend reading up on WCF services.   Any introductory article will show you how to set one up on the same machine.  Obviously, you'll need a separate solution to be installed on the server but the principle is similar.  You publish the service to the server.  Register it within your client solution.

    Monday, April 18, 2011 7:07 AM
  • Depending on your application MVC may be overkill.  It also works far better for web application IMO.  I would avoid socket programming alltogether.  SOAP (Web Services) and WCF allow far better functionality for most applications.  For any application (web or thick client) I would use WCF to communicate to a service layer that communicates with your database.  I would also make this service layer stateless so it will scale well.  Constructed appropriately your same services (which are the core functionality of your application) can be implemented in a variety of presenations like WPF, ASP.NET/MVC, WinForms, or something totally different.  Martin Fowler used to say that a good test would be if you could change the front end to be a command line.  His advice is still good a decade later, your services (or even just business objects) should be composed in a way that the UI isn't doing more than just presentation (i.e. no business logic). 

    Kind Regards,

    -Dan


    If this answers your question, please Mark as Answer
    Monday, April 18, 2011 7:28 PM