469,643 Members | 1,753 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

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

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
14 1904
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
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
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
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
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
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
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
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
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
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
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
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
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
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.

Similar topics

8 posts views Thread by Henrik | last post: by
2 posts views Thread by Jeff Williams | last post: by
4 posts views Thread by Chris Botha | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.