?
Solved

web frontend for a C# application

Posted on 2005-04-27
9
Medium Priority
?
248 Views
Last Modified: 2010-04-16
I have recently developed, in C#, (and am testing and constantly improving) a large program, compete with GUI that spawns a number of seperate processes.  The output screens of each of these console processes are captured and displayed in real-time in a listbox (seperate form/listbox for each process).  Also, the contents of each processes' console output is parsed and checked for error conditions.  The resource usage for each process is retrievable via the GUI, and any log file associated with each process is tracked and parsed in case that particular process fails.  If a process does fail, and a specific logging standard is observed, the log file is parsed in an attempt to determine what caused the failure.  Finally, when an error condition is detected in any of the processes, an alert is generated.  All alerts are collected and viewable with timestamps on a tab on the GUI.  Very severe alerts prompt information to be sent to email addresses and cell phones.  Also, if a process were to fail unexpectedly, a severe alert is generated, and the process is restarted.  

With that out of the way, I have thought about providing a web-based frontend for my application.  I figure I should start out simple.  With this in mind, I would like to develop a web frontend that lists specific information about each process, as well as the master program itself.  I imagine that this should be done using ASP, though I have never worked with ASP before (though I have worked with JSP).  I don't even know where to start, but I would think that the web frontend would need to be able to call methods on the application itself to gather data.  Can someone get me pointed in the right direction?  I'm sure I will have a LOT of questions on this issue, and I expect this thread will get fairly large and stay open for a while.
0
Comment
Question by:rnicholus
  • 5
  • 3
9 Comments
 

Author Comment

by:rnicholus
ID: 13882726
I should mention that my program does a lot more than I mentioned, but I figured a brief summary was all that was needed.
0
 
LVL 9

Expert Comment

by:BurntSky
ID: 13882848
Well, to put it simply, it's not possible to have both a WinForms/Console gui as well as a web interface.  They run as completely different types of applications.  Your best bet is to use a database to log application data (which will be written with the WinForms/Console applications) and then read the database with the web application.  One nice thing about .NET applications, though, is that different types of applications can share a class library.  This way you can just create one class library (business logic layer, if you will) that contains all the reading/writing code and then reference the .dll from any application (winforms/console/web).
0
 
LVL 1

Assisted Solution

by:pbowens
pbowens earned 400 total points
ID: 13882920
Hi there,

I think I understand what you are trying to do.

The way I would approach this (if you need to stick to console output), is to output to a file on disk, and then use your WEB GUI to read this file and present it in a nice format. You can have your console application running anywhere, as long as the web server has access to the output of the console application.

If you are planning on only viewing the output of your console apps via a web gui, then you can dispense with any formatting on the console end, and output your data in XML. This way you can also investigate using XML stylesheets to format your output and display it in a user friendly way. If you need to change the look and feel of the output, just update the stylesheet without needing to change your application.

Of course doing this via database logging is also an excellent solution, and probably the preferred method if you are able to do it. But if your expertise is reading and writing from files, and you want to stick to that, then I would look at the above.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:rnicholus
ID: 13885734
I'm not sure I understand your suggestion.

>>The way I would approach this (if you need to stick to console output), is to output to a file on disk, and then use your WEB >>GUI to read this file and present it in a nice format. You can have your console application running anywhere, as long as >>the web server has access to the output of the console application.

There are times when my master program might be controlling 100 seperate console applications.  Even if I had 100 seperate files displaying output for each seperate process, this still leaves out all of the other data I want to display on my web frontend, such as resources usage for each process.  As well as failure counts, alerts for each process, running time for each process, etc, etc.  There must be some way that my web frontend can talk to my winforms app.  
0
 
LVL 9

Expert Comment

by:BurntSky
ID: 13887651
There's not really an easy way.  I suppose you could probably do it using some set of ridiculous API calls.  

Really, the best way to do this is to have the master program write its observations to a database or a file and then have the web application read it.  

Alternatively, if you were to write almost all of the master programs code in a business logic layer class library you could allow your web application to basically become a second instance of the master program.
0
 

Author Comment

by:rnicholus
ID: 13887717
Well, I suppose I could have my mast program write all of its observations to a file or DB, but this seems like it would require quite a bit of overhead.  

I'm not sure I know what a business logic layer class library is.  Also, when you say I could allow my web app to basically become a second instance of my master program, what does this mean exactly?
0
 
LVL 9

Accepted Solution

by:
BurntSky earned 1600 total points
ID: 13888515
In standard Enterprise Application design, the logic is split into layers (or tiers).  You may have heard the term N-Tier before; the 'N' stands for any number.  Generally, enterprise applications are split into 3 different tiers: Presentation, Business and Data.  The Presentation layer is composed of your UI elements and the logic DIRECTLY responsible for their behavior.  The Business layer is responsible for calculation methods pertaining to the actual purpose of the application (generally it enforces business rules, etc.); it also will contain arbitrary classes for representing certain complex business objects (for example, a Customer class or an Insurance Policy class). The Data layer can be viewed from several ways.  Technically speaking, the Data layer is the actual database or disk representation of data; it can also be the classes responsible for connecting to the database and direct manipulation of the data.  The layers work together by passing data to each other to create an easily manageable enterprise application.  And that is Enterprise Application Design 101.  =)

In your case, all the logic that gathers and interperets the data from your console applications should be the "business logic layer."  If you separate this logic into a class library project you can quite easily create multiple presentation layers that access it (a WinForms application and a Web application, per se.)  As I mentioned before, the presentation layer contains only the code directly responsible for displaying and manipulating the UI, so the two applications would not share any of the same code; they would both, however, reference the business layer you created.

Also, I do agree that writing all its observations to a database would create a fair amount of overhead for your master program.  However, if it's running on a fast enough server and you've written efficient code/stored procedures/etc. you shouldn't notice much of a decrease in performance.
0
 

Author Comment

by:rnicholus
ID: 13922622
BurntSky:

Thank you for your comments and information regarding Enterprise Applications.  It is helpful for me to be aware of such details and methods.  I am going to keep this thread open for a few more days, just to make sure I have covered all of my bases.
0
 

Author Comment

by:rnicholus
ID: 13937353
Ok.  I'm going to close this up for now.  When or if I get around to this portion of my project, I may re-open as another topic if I need any additional info.  Thanks everyone.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Loops Section Overview
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question