473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Question about Namespaces

The other day I was working with a 3rd party assembly.

Lets say that all the classes from this assembly were under the
namespace:

3rdParty.Components.MathLibrary

Now, I wanted to write a few quick structs/classes that would help to
better represent some of the classes in the
3rdParty.Components.MathLibrary, they were going to basically be
facades or wrappers or whatever.

I thought it would be easier to logically group these classes within
the 3rdParty.Components.MathLibaray namespace, but when I tried to
declare that same namespace for some of my classes, I lost the ability
to use any of the code from the real 3rdParty.Components.MathLibrary.

Is there no way to do what I was trying to achieve? I know I could
(and did) just build the classes in my own namespace, but the classes I
wrote were ones that I found "missing" in the provided assembly, and
they didn't really belong with what I was working on b/c they were
specific to the assembly.

Why is this not allowed?

Nov 17 '05 #1
4 905
cmay <cm**@walshgroup.com> wrote:
The other day I was working with a 3rd party assembly.

Lets say that all the classes from this assembly were under the
namespace:

3rdParty.Components.MathLibrary

Now, I wanted to write a few quick structs/classes that would help to
better represent some of the classes in the
3rdParty.Components.MathLibrary, they were going to basically be
facades or wrappers or whatever.

I thought it would be easier to logically group these classes within
the 3rdParty.Components.MathLibaray namespace, but when I tried to
declare that same namespace for some of my classes, I lost the ability
to use any of the code from the real 3rdParty.Components.MathLibrary.

Is there no way to do what I was trying to achieve? I know I could
(and did) just build the classes in my own namespace, but the classes I
wrote were ones that I found "missing" in the provided assembly, and
they didn't really belong with what I was working on b/c they were
specific to the assembly.

Why is this not allowed?


It is, as far as I'm aware.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

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

I was actually writing this app in VB.net. When I went to code up an
example in C# it worked just fine.
I figured the C# newsgroups would be better to post to about namespaces
than the VB ones, but maybe this is something have VB just can't do,
and C# can.

What I mean is this code does NOT work in VB.NET. It will not compile
b/c it can't find the "RotatorDesigner" class.

Is this a known thing that VB.Net can't do?

using System;
using ComponentArt.Web.UI.Design;
namespace ClassLibrary1
{
public class Class1
{
ComponentArt.Web.UI.Design.RotatorDesigner X;
ComponentArt.Web.UI.Design.MyTestClass Y;

public Class1()
{
}
}
}

namespace ComponentArt.Web.UI.Design
{
public class MyTestClass
{
public MyTestClass()
{

}
}
}
It is, as far as I'm aware.


Could you post a short but complete program which demonstrates the
problem?

Nov 17 '05 #3
cmay <cm**@walshgroup.com> wrote:
I was actually writing this app in VB.net. When I went to code up an
example in C# it worked just fine.
I figured the C# newsgroups would be better to post to about namespaces
than the VB ones, but maybe this is something have VB just can't do,
and C# can.

What I mean is this code does NOT work in VB.NET. It will not compile
b/c it can't find the "RotatorDesigner" class.

Is this a known thing that VB.Net can't do?


I don't know, to be honest. I suggest you ask in the VB.NET newsgroup -
they're likely to know there.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
Yea that is probably what I should have done in the first place.

Thanks.

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.