Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Why isolate pages in their own namespace?


Message #1 by "Oliver, Wells" <WOliver@l...> on Wed, 4 Sep 2002 15:45:26 -0700
Is there a benefit to putting your page classes in their own namespace?

For example, I usually just do:

public class MyTestPage : System.Web.UI.Page
{
	..
}

I've been looking at some code examples and I see some folks do:
namespace myApplication
{
	public class MyTestPage : System.Web.UI.Page
	{
	..
	}
}

Can anyone speak to the advantages of this? Thanks!

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com

Message #2 by "Andrew Bradnan" <andrew@w...> on Wed, 4 Sep 2002 17:27:14 -0700
I'm addicted to the namespaces already.

You don't have to think of 4,000 class names to describe the best name.  
Using your example, there's no reason to call it MyTestPage.  It's a 
Page right?  Well, call it that.

For example....
namespace myApplication
{
	public class Page : System.Web.UI.Page
	{
	..
	}
}

If you "share" (ala VSS) a file amongst a few applications, then it's 
more trouble, unless you only have one application/namespace name (but 
you should be using a library at this point anyway).

Hope that helps,
Andrew

http://whirly.info
.NET forums for developers

-----Original Message-----
From: Oliver, Wells [mailto:WOliver@l...]
Sent: Wednesday, September 04, 2002 3:45 PM
To: ASP+
Subject: [aspx] Why isolate pages in their own namespace?


Is there a benefit to putting your page classes in their own namespace?

For example, I usually just do:

public class MyTestPage : System.Web.UI.Page
{
	..
}

I've been looking at some code examples and I see some folks do:
namespace myApplication
{
	public class MyTestPage : System.Web.UI.Page
	{
	..
	}
}

Can anyone speak to the advantages of this? Thanks!

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com


---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---
Message #3 by =?ks_c_5601-1987?B?wMy1v7n8?= <funnyfox@d...> on Thu, 5 Sep 2002 14:58:53 +0900
With using Namespace, we could separate our application modules more
logically.
But it's your choice.
But if I were you, I would use my own Namespace for my application
being more clear.

Dongbum Lee
 .NETXPERT Solution Consultant. Microsoft MVP
-----Original Message-----
From: Oliver, Wells [mailto:WOliver@l...]
Sent: Thursday, September 05, 2002 7:45 AM
To: ASP+
Subject: [aspx] Why isolate pages in their own namespace?

Is there a benefit to putting your page classes in their own namespace?

For example, I usually just do:

public class MyTestPage : System.Web.UI.Page
{
	..
}

I've been looking at some code examples and I see some folks do:
namespace myApplication
{
	public class MyTestPage : System.Web.UI.Page
	{
	..
	}
}

Can anyone speak to the advantages of this? Thanks!

Wells Oliver
Web Application Programmer
Leviton Voice & Data
xxx-xxx-xxxx
http://www.levitonvoicedata.com


---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---

  Return to Index