Results 1 to 2 of 2

Thread: All internal classes

  1. #1

    Thread Starter
    Fanatic Member steve65's Avatar
    Join Date
    Jun 2000
    Posts
    610

    All internal classes

    I have a project that I am working on that I do not intend to have any of the methods available outside of the project and so I was going to set all of my classes to internal.

    Class1 would be my main program and Class2 to ... Classx will contain all of my methods broken up by functionallity.

    Is there a reason as to why you would not want to have a project setup like this:
    Code:
    using System;
    using System.Windows.Forms;
    
    namespace WindowsApplication1
    {
    	/// <summary>
    	/// Summary description for Class1.
    	/// </summary>
    	internal class Class1
    	{
    		internal Class1()
    		{
    			//
    			// TODO: Add constructor logic here
    			//
    		}
    
    		internal static void Main()
    		{
    			Class2.testmthd();
    		}
    	}
    }
    and this:
    Code:
    using System;
    using System.Windows.Forms;
    
    namespace WindowsApplication1
    {
    	/// <summary>
    	/// Summary description for Class2.
    	/// </summary>
    	internal class Class2
    	{
    		internal Class2()
    		{
    			//
    			// TODO: Add constructor logic here
    			//
    		}
    
    		internal static void testmthd()
    		{
    			MessageBox.Show("This is a test");
    		}
    	}
    }
    This space for rent...

  2. #2
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Re: All internal classes

    FWIW, I don't think there's anything wrong with this, as long as you realize what the internal accessability level does (limits scope to the current assembly).

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width