Solved

Architecture guides?

Posted on 2006-07-18
5
225 Views
Last Modified: 2010-04-16
Hi

I'm a relative newbie to C# programming and the whole Visual Basic approach.

I wrote an application to monitor if websites are up or down and I can click on a date and get a pie chart of the up and downtime for any given day.

Now my problem is that all my code is within one Form - 'Form1'

Anyone know any tutorials (or just general adivce) on home to split it up?

In general should one screen in an application have one .cs page?
I have a tab control in my form. Should I spilt each tab into a page?
And I also have a file called NetworkTools.cs which has functions like

/// <summary>
        /// Returns an arraylist on the PCs on the network
        /// </summary>
        /// <returns></returns>
public static ArrayList getComputers()
       
/// <summary>
        /// checks if an email is in the correct format
        /// </summary>
        /// <param name="inputEmail"></param>
        /// <returns></returns>
        public static bool isValidEmail(string inputEmail)

Is this good practise?

Thanks!
H

0
Comment
Question by:hmcgeehan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 1

Accepted Solution

by:
Prambo earned 50 total points
ID: 17129222
There is an article in MSDN Magazine about best practices for UI programming, introducing a "new" pattern called MVP:
http://msdn.microsoft.com/msdnmag/issues/06/08/DesignPatterns/default.aspx

Yes, you should have one .cs page for each screen. Whether you split the tab into a page or not is a matter of taste but it sounds like a good idea to me.
The class NetworkTools.cs seems to just contain static utility functions and that is ok also, depending on if there is no other place where they would fit better, like e.g. an email class for isValidEmail.
0
 
LVL 8

Expert Comment

by:navalarya1982
ID: 17142764
hi,

You need not worry much abt design issues in this early.. stages.. :) just design things and they should work...

now regardsing ur design query

as a general rule.. we should not have non ui related code in form1 file. so u need to move it to new file and implement that logic in some class file.

this approach is good in sense that tomorrow u can change ur presentation layer more easily.. today u have windows from if u want to go for cosole or web then u can do it more easily...

So always better idea to seperate presentation layer and business logic layer.

regards,
Naval
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 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