Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Everyone

I am working on a desktop application project in C# where I have a front-end system and a back-end system.
The front-end system collects requests from customers and stores it in the database.
The back-end system uses the same database and processes the request..
The front-end and the back-end system must work on two different computers.
Also I want a third screen which displays updates, information etc by retrieving it from the database. That is there is no interaction with user, solely used for display purpose.
Basically all these should communicate with each other.

My question is how do I proceed?
I have designed the front-end system and connected to the sql server 2008 database.
My doubt is
Do I have to create different projects for the different tasks and connect them to the same database.
If no then how do I proceed?
Do I have to set the system in a network?
Please help.
Posted
Comments
Maciej Los 7-Aug-13 2:44am    
Your question is a bit confusing... ;(
I suppose that you need the same front-end but for different types of users.
Sergey Alexandrovich Kryukov 7-Aug-13 2:46am    
I found some way to answer, but it wasn't easy, please see, pretty interesting... :-)
—SA
Maciej Los 7-Aug-13 3:06am    
Thank you, Sergey, for directing my attention on your answer.
You'll see my comment to the answer soon. ;)
JPais 7-Aug-13 3:02am    
Sorry for being confusing.

I want 2 different front ends, one for the customers and one for the operator. Both should be a Windows form. (I guess you were confused by the word back-end) using the same database and should run on different computers.
And a third screen to be used just for displaying purpose.
Maciej Los 7-Aug-13 3:17am    
I guess you were confused by the word back-end - yes.
I'm still not get you as i wish to understand your issue...
What you mean: "a third screen (...) for displaying purpose (...) updates, information, etc by retrieving it from the database".
If i understan you well: client sends a request (one computer), there is another person on second computer (Stuff person) which process with client's request. Stuff person saves the information about request (what have been done, etc.), which should be visible for client(third screen). Am i right?

You don't need an expert to answer your questions, you need someone like Captain Obvious.

I'll try…

Yes, you have to create different projects, but put them in a single solution for development and build. Only two different projects can yield different assemblies, right? Even though it's possible to imaging that the copy of the same exact assembly could play the different roles on different machine (modifying the behavior based on, say, different configuration files), this scheme would look quite artificial. The behavior of front-end and back-end is essentially different. More importantly, its very likely that those two different applications should take a form of different application type. Isn't it obvious that front-end should be a Windows application? (Well, nothing in the question sounds like a Web application.) As to the back-end, the most adequate form of it would be the Windows Service application. Now, I used to develop application which can behave as both Windows Service and a Windows application depending on how you host them, but this is a pretty tricky solution. I had very special reasons for such and advanced solution and would not advise you do go that far unless you also have very special reasons. In your case, I don't see them. So, we are ending up with separate projects and separate assemblies.

Now, can it be just two projects and two assemblies? Hardly, really. Even though it is technically possible, it would not sound reasonable. Why? If you have two applications working together, they always have a lot of code in common. At least some data type declarations, but in practice, a lot more. Hence, we are coming to having some more assemblies referenced by both application assemblies, and some have to be shared by the two.

By the way, one useful advise: if you have to prepare such lower-layer set of assemblies to be shared by some assemblies in upper layer(s), isolate UI and non-UI class libraries. There are a lot more considerations about isolation of code, aspects and loose binding, but isolation out of UI is one of the most important things in practice. And perhaps you need to learn all those architectural patterns like MVC, MVP, MVA and MVVM…

Should you "connect them to the same database"? Hm… Well, but how else? Connecting them to different unrelated databases? To no database? What would be the point? I hope I don't need to continue on this part.

Now, setup in a network? Well, it depends on what you need and what the requirements are. Theoretically speaking, you can indirectly interact through the client-server system and nothing else. Is it enough? I don't know. You did not explain what exactly your application should do. I only would note that the pure client-server model is extremely poor and often is not enough. For example, you would only need to use polling, pull technology and no push technology, which would be extremely poor and might be wasteful. To understand the issues, please see:
http://en.wikipedia.org/wiki/Pull_technology[^],
http://en.wikipedia.org/wiki/Push_technology[^].

—SA
 
Share this answer
 
v2
Comments
Maciej Los 7-Aug-13 3:26am    
Sergey, your answer is complete - as always - and even now deserves for 5! ;)
But i'm not sure what OP wants to do, what kind of issue He has. See my comment to OP's comment. I think the issue is much much easier than it looks like...
Sergey Alexandrovich Kryukov 7-Aug-13 3:41am    
Hm... From your guesswork, it looks like OP does not need a back-end, it's just one more front end... I don't really know why it's easier. Anyway, I did not know those details and have chosen to pick up formally on the questions as they are formulated. The real impression — even now — that OP poorly understand what he wants...
Anyway, thank you, Maciej.
—SA
Maciej Los 7-Aug-13 4:27am    
Could you, please, see my answer? ;)
First of all, please, read Sergey's answer and His comments.

What i suggest to do is to create one application (one project), where finally it should contains 2-3 windows (login form, client/stuff person screen/form, details form to enter/display information about request). Client and Stuff person must log-in into application (you probably should store information about request and who - which Stuff person - enter this information into system. Depending on who has logged-in into application, display second form (client/stuff person form) and enable/disable or display/hide some options/menu. Client should see only own requests, Stuff person should see all client's requests.

It's just a proposal, but i believe it meets your needs.

[EDIT]
JPais asked:
Do I have to set the system in a network?


There is not possible to answer it in few words. Please, follow below links:
ADO.NET[^]
SQL Server and ADO.NET[^]
Retrieving and Modifying Data in ADO.NET[^]
DataSets, DataTables, and DataViews[^]
ADO.NET Code Examples[^]

Please, read related articles too.
[/EDIT]
 
Share this answer
 
v3
Comments
Sergey Alexandrovich Kryukov 7-Aug-13 9:39am    
Yes, some good points here, 5ed.
—SA
Maciej Los 7-Aug-13 14:55pm    
Thank you, Sergey ;)
Your Front-end and Back-end system may be anywhere.

What you need to do is, connecting the Front-end with the Back-end by using appropriate ConnectionString.

More on ConnectionStrings - www.connectionstrings.com[^][^]

As Maciej Los gave you some links on ADO.NET, so you need to use that technology in order to communicate between the Front-end and Back-end.
 
Share this answer
 
Why not just use a web interface.... that way you can access if from any device capable of running web browser.... pc, smartphone, tablet.... Makes more sense to me than to try and develop for every device out on the market. You are platform independant!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900