By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

How would you handle needed "System" class/table/form in application?

P: n/a
I'm just curious how you would handle this. In the cable industry, Comcast
is referred to as an "MSO" (multiple systems operator) meaning they own many
cable systems. Therefore a solution must be architected to accommodate
"System" as an entity. This means a table in the database named System, a
class System, a web form System, etc.

Since System is such a reserved word, how should we do this? To rename it
"CableSystem" would bug as isn't consistent/what is desired (should have to
change our business terminology because conflicts with development tool).
For the class, it could be named "System" and just wrapper a namespace
around it named "Classes". But for the web form, while it could be named
System.aspx, you can't just wrap a namespace around it.

Hungarian notation is "out" these days so I'm looking for a good
standardized and consistent approach for all such names that might conflict.

Thanks,
Ron


May 2 '07 #1
Share this Question
Share on Google+
14 Replies


P: n/a
Ronald S. Cook <rc***@westinis.comwrote:
I'm just curious how you would handle this. In the cable industry, Comcast
is referred to as an "MSO" (multiple systems operator) meaning they own many
cable systems. Therefore a solution must be architected to accommodate
"System" as an entity. This means a table in the database named System, a
class System, a web form System, etc.

Since System is such a reserved word, how should we do this? To rename it
"CableSystem" would bug as isn't consistent/what is desired (should have to
change our business terminology because conflicts with development tool).
For the class, it could be named "System" and just wrapper a namespace
around it named "Classes". But for the web form, while it could be named
System.aspx, you can't just wrap a namespace around it.
System isn't a reserved word - it's just a prominent namespace. It's
likely to be a bit of a pain working with System as the name of a
class, but it should be doable. What problems are you having?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 2 '07 #2

P: n/a
Well, the web form inherits from System.Web... so even if I wrap it in a
namespace, that doesn't fly.
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP********************@msnews.microsoft.com.. .
Ronald S. Cook <rc***@westinis.comwrote:
>I'm just curious how you would handle this. In the cable industry,
Comcast
is referred to as an "MSO" (multiple systems operator) meaning they own
many
cable systems. Therefore a solution must be architected to accommodate
"System" as an entity. This means a table in the database named System,
a
class System, a web form System, etc.

Since System is such a reserved word, how should we do this? To rename
it
"CableSystem" would bug as isn't consistent/what is desired (should have
to
change our business terminology because conflicts with development tool).
For the class, it could be named "System" and just wrapper a namespace
around it named "Classes". But for the web form, while it could be named
System.aspx, you can't just wrap a namespace around it.

System isn't a reserved word - it's just a prominent namespace. It's
likely to be a bit of a pain working with System as the name of a
class, but it should be doable. What problems are you having?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

May 3 '07 #3

P: n/a
Ronald S. Cook <rc***@westinis.comwrote:
Well, the web form inherits from System.Web... so even if I wrap it in a
namespace, that doesn't fly.
Without an example of where it's actually stopping you, it's hard to
help much more, I'm afraid.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #4

P: n/a
Ok, the below won't fly and I don't want to rename all my (form) classes to,
like, "SystemForm" or "frmSystem". Thanks.

System.aspx
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Forms
{
public partial class System : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Classes.System System = new Classes.System();
Response.Write(System.SelectSystem());
}
}
}
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP********************@msnews.microsoft.com.. .
Ronald S. Cook <rc***@westinis.comwrote:
>Well, the web form inherits from System.Web... so even if I wrap it in a
namespace, that doesn't fly.

Without an example of where it's actually stopping you, it's hard to
help much more, I'm afraid.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

May 3 '07 #5

P: n/a
On May 3, 5:34 am, "Ronald S. Cook" <r...@westinis.comwrote:
Ok, the below won't fly and I don't want to rename all my (form) classes to,
like, "SystemForm" or "frmSystem". Thanks.

System.aspx
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Forms
{
public partial class System : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Classes.System System = new Classes.System();
Response.Write(System.SelectSystem());
}

}
}
.... which fails to compile because:
"The type name 'Web' does not exist in the type
'WebApplication1.System'"

One solution is to qualify all references to the "standard" System
namespace:

public partial class System : global::System.Web.UI.Page

Michael

May 3 '07 #6

P: n/a
Ooh... good idea! I'll try..thx

<mp*******@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 3, 5:34 am, "Ronald S. Cook" <r...@westinis.comwrote:
>Ok, the below won't fly and I don't want to rename all my (form) classes
to,
like, "SystemForm" or "frmSystem". Thanks.

System.aspx
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Forms
{
public partial class System : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Classes.System System = new Classes.System();
Response.Write(System.SelectSystem());
}

}
}

... which fails to compile because:
"The type name 'Web' does not exist in the type
'WebApplication1.System'"

One solution is to qualify all references to the "standard" System
namespace:

public partial class System : global::System.Web.UI.Page

Michael

May 3 '07 #7

P: n/a
Hmm.. that doesn't seem to help.
<mp*******@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 3, 5:34 am, "Ronald S. Cook" <r...@westinis.comwrote:
>Ok, the below won't fly and I don't want to rename all my (form) classes
to,
like, "SystemForm" or "frmSystem". Thanks.

System.aspx
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Forms
{
public partial class System : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Classes.System System = new Classes.System();
Response.Write(System.SelectSystem());
}

}
}

... which fails to compile because:
"The type name 'Web' does not exist in the type
'WebApplication1.System'"

One solution is to qualify all references to the "standard" System
namespace:

public partial class System : global::System.Web.UI.Page

Michael

May 3 '07 #8

P: n/a
Heck, .NET renames the class for Default.aspx to _Default so I guess I could
do that (i.e. _System). I'm just big on having a standard that is used
everywhere (and not just for conflicting names).

<mp*******@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
On May 3, 5:34 am, "Ronald S. Cook" <r...@westinis.comwrote:
>Ok, the below won't fly and I don't want to rename all my (form) classes
to,
like, "SystemForm" or "frmSystem". Thanks.

System.aspx
-------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Forms
{
public partial class System : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Classes.System System = new Classes.System();
Response.Write(System.SelectSystem());
}

}
}

... which fails to compile because:
"The type name 'Web' does not exist in the type
'WebApplication1.System'"

One solution is to qualify all references to the "standard" System
namespace:

public partial class System : global::System.Web.UI.Page

Michael

May 3 '07 #9

P: n/a
On May 3, 9:36 am, "Ronald S. Cook" <r...@westinis.comwrote:
Hmm.. that doesn't seem to help.
A little more detail, maybe? Works for me, using your sample class.

Michael

May 3 '07 #10

P: n/a
I created System.aspx. In code behind, I added "global::" in front of
System.Web.UI.Page and still got a ton of errors. All of the "using
System.Whatever" statements at the top balk refering to the wrong "System".
Other places too.

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

public partial class System : global::System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

}
<mp*******@gmail.comwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
On May 3, 9:36 am, "Ronald S. Cook" <r...@westinis.comwrote:
>Hmm.. that doesn't seem to help.

A little more detail, maybe? Works for me, using your sample class.

Michael

May 3 '07 #11

P: n/a
Ronald S. Cook <rc***@westinis.comwrote:
I created System.aspx. In code behind, I added "global::" in front of
System.Web.UI.Page and still got a ton of errors. All of the "using
System.Whatever" statements at the top balk refering to the wrong "System".
Other places too.
Put the type in a namespace (as your previous code sample had) and it
compiles fine.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #12

P: n/a
It's weird. When I do that (code below), I still get these 3 errors:

Error 1 The type name 'Web' does not exist in the type
'Westinis.Reminde.Forms.System'
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\westinis.reminde.client\322f9295\acfb6d8\App _Web_u06cz-po.0.cs 15

Error 2 The type name 'Web' does not exist in the type
'Westinis.Reminde.Forms.System'
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\westinis.reminde.client\322f9295\acfb6d8\App _Web_u06cz-po.0.cs 17

Error 3 The type name 'Web' does not exist in the type
'Westinis.Reminde.Forms.System'
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temp orary ASP.NET
Files\westinis.reminde.client\322f9295\acfb6d8\App _Web_u06cz-po.0.cs 23

Here's the code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Westinis.Reminde.Forms
{
public partial class System : global::System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*******************@msnews.microsoft.com...
Ronald S. Cook <rc***@westinis.comwrote:
>I created System.aspx. In code behind, I added "global::" in front of
System.Web.UI.Page and still got a ton of errors. All of the "using
System.Whatever" statements at the top balk refering to the wrong
"System".
Other places too.

Put the type in a namespace (as your previous code sample had) and it
compiles fine.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

May 3 '07 #13

P: n/a
Ronald S. Cook <rc***@westinis.comwrote:
It's weird. When I do that (code below), I still get these 3 errors:
Odd. Where do lines 15, 17 and 23 fall in your code? Because pasting
your code directly into into a text editor, there are only 22 lines as
far as I can see...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
May 3 '07 #14

P: n/a
Yeah, it's referencing some sort of behind-the-scenes temp file. Each time
I rebuild (and get the same 3 errors), the name of that file it references
changes.
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP********************@msnews.microsoft.com.. .
Ronald S. Cook <rc***@westinis.comwrote:
>It's weird. When I do that (code below), I still get these 3 errors:

Odd. Where do lines 15, 17 and 23 fall in your code? Because pasting
your code directly into into a text editor, there are only 22 lines as
far as I can see...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

May 3 '07 #15

This discussion thread is closed

Replies have been disabled for this discussion.