none
Simple client & admin -> server -> database RRS feed

  • Question

  • Hello

    I want to develop a point of sale solution. My idea is to have a client application (vb.net forms windows application which will be the touch screen point of sale app) and an admin application (forms again, used for adding products, prices, stock taking etc.). Both these communicate on the local network with a third windows forms application which will run on a second machine and be the "server". The server contains all the business logic, data manipulation etc. and communicates with the SQL database.

    I know the admin and POS app could communicate directly with the SQL server, but I want the server app in place to do the business logic, logging, tracking, etc. and be a windows forms app for monitoring current connections etc. and be able to be run on a dedicated machine. Keeping the POS and admin applications separate also keeps things simple to manage for the end user - who would probably have a central machine in an office for admin work but multiple POS machines on the shop floor.

    The server app should allow multiple connections.

    I've Googled the hell out of this and can't find any clear examples. I've found loads of examples of simple "chat" client server applications but nothing that shows me how to implement database communication and, more to the point, how to send that data back to the client. I can also find loads of examples of remote communication with a SQL server. My idea is that the POS client would simply send "commands" to the server application (example: GetAllProducts) and the server queries the database and replies with a list of all products to be displayed on the screen of the POS.

    The admin app would naturally have more control (example: CreateProduct). All the "commands" would be defined and stored on the server app.

    I have reasonable knowledge when it comes to simple applications and can hold my own when coding but this architecture is confusing the hell out of me.

    Any good starting points, tutorials, or examples to download? Anyone got a simple working example? Or would anyone be so kind as to rustle something up? - just showing the basics of course!

    Many thanks for anything you can provide!

    NH


    • Edited by nhwebforge Saturday, June 9, 2018 5:07 PM Typo
    Saturday, June 9, 2018 5:05 PM

All replies

  • I want to develop a point of sale solution. My idea is to have a client application (vb.net forms windows application which will be the touch screen point of sale app) and an admin application (forms again, used for adding products, prices, stock taking etc.). Both these communicate on the local network with a third windows forms application which will run on a second machine and be the "server". The server contains all the business logic, data manipulation etc. and communicates with the SQL database.

    You would be looking at SOA, like using WCF on a machine that is an application server.

    https://www.techopedia.com/definition/432/application-server

    <copied>

    An application server is a type of server designed to install, operate and host applications and associated services for end users, IT services and organizations. It facilitates the hosting and delivery of high-end consumer or business applications, which are used by multiple and simultaneously connected local or remote users.

    <end>

    https://www.codeproject.com/Articles/515253/Service-Oriented-Architecture-and-WCF

    What you should be interested in is a n-tier solution.

    https://docs.microsoft.com/en-us/previous-versions/msp-n-p/ee658117(v=pandp.10)

    https://msdn.microsoft.com/en-us/library/bb384398.aspx

    The client's are the Windows form solutions you are talking about that are consuming the services provided by the service application that are sitting the backend, which the BLL and DAL can be sitting on the backend behind the services.

    What you want is SoC implemented in your solution. 

    https://en.wikipedia.org/wiki/Separation_of_concerns

    Youi may also look into using MVP with Windows forms or maybe MVVM and using WPF. WPF is another Windows desktop form solution. MVP and MVVM implement SoD.

    https://www.codeproject.com/Articles/228214/Understanding-Basics-of-UI-Design-Pattern-MVC-MVP

    Here is a simple n-tier tutorial, but it is using WCF Web service over HTTP. What you want is to change it to WCF over TCP, but it's hard to find VB.NET examples.

    https://msdn.microsoft.com/en-us/library/bb384570.aspx?f=255&MSPPError=-2147217396

    I have reasonable knowledge when it comes to simple applications and can hold my own when coding but this architecture is confusing the hell out of me.

    What architecture are you talking about, becuase IMHO, you have none. 

    Any good starting points, tutorials, or examples to download? Anyone got a simple working example? Or would anyone be so kind as to rustle something up? - just showing the basics of course!

    It's something you have to learn. No one can do it for you but you. But the key is can you architecture the solution from the presentation tier to the backend tier.

    https://www.codeproject.com/Articles/21115/Building-an-N-Tier-Application-in-VB-NET-in-Step

    Saturday, June 9, 2018 7:30 PM
  • For a small-scale system and without getting into complex frameworks, one possible architecture would be:

    1. A Windows Service application for the "server" computer.

    This application would follow the same basic design in this example, but without the user interface and refactored for a service application.  This application would also house the local database file used for your backend data, or the connection to the database server instance. 

    2. Common Reference Assemblies

    The protocol defined in that example project could be used as-is, or as a basis, for transmitting your messages between applications, if you want to use XML-styled messages.  This could be located in a reference assembly that each application can reference (so that the same message object(s) can be used in each program).

    Depending on your choice of data access there may be a separate reference assembly providing common data object schema (or models) for each application to access.

    3. A Windows Forms application for the admin console.

    This application would be similar to the client example code and would contain user interfaces for administering the service and database.

    4.  A Windows Forms application for the POS client.

    This application would also be similar to the client example and would contain functionality for communicating with external POS devices/services such as credit card processors and receipt printers.

    Overall this is a fairly complex project so don't be surprised that you can't find complete examples.  You'll need to find examples of the individual steps (of which there are many) and then put the most relevant ones together to suit your needs. 


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Sunday, June 10, 2018 8:44 PM
    Moderator