Solved

Architecture guides?

Posted on 2006-07-18
5
226 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

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!

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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