Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Architecture guides?

Posted on 2006-07-18
5
Medium Priority
?
229 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 200 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

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!
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

597 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