.NETGURU
Namespace Management
Messages   Related Types
This message was discovered on microsoft.public.dotnet.academic.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Don Wash
Hi There!

I just need some advice on Namespace management for creating reusable VB.NET
applications.

I would like my applications to have this namespace structure...

Namespace MyCompany

Namespace MyApplication1

Namespace Module1

End Namespace

End Namespace

End Namespace

However, I find it hard to enforce this structure throughout many different
VB.NET files and projects. For example, I need to manually type in Namespace
for MyCompany, MyApplication1 and Module(n) for every VB.NET class files.

Is there anyway to define a namespace on the Root directory and all the
VB.NET files in the child directory automatically inherits the parent
Namespace?

Thanks in advance!

Don

Reply to this message...
 
    
Ken Tucker [MVP] (VIP)
Hi,

In the projects properties you can set the root namespace.

Ken
----------------
"Don Wash" <Click here to reveal e-mail address> wrote in message
news:us$Click here to reveal e-mail address...
Hi There!

I just need some advice on Namespace management for creating reusable VB.NET
applications.

I would like my applications to have this namespace structure...

Namespace MyCompany

Namespace MyApplication1

Namespace Module1

End Namespace

End Namespace

End Namespace

However, I find it hard to enforce this structure throughout many different
VB.NET files and projects. For example, I need to manually type in Namespace
for MyCompany, MyApplication1 and Module(n) for every VB.NET class files.

Is there anyway to define a namespace on the Root directory and all the
VB.NET files in the child directory automatically inherits the parent
Namespace?

Thanks in advance!

Don

Reply to this message...
 
    
Don Wash
Hi Ken,

Thanks for the reply. I can now set it. However, as I presented the
Namespace structure in my previous post, my Namespace structure looks like
following...

Namespace MyCompany

Namespace MyApplication1

Namespace Module1

End Namespace

End Namespace

End Namespace

So as you can see, there will be no projects whatsoever using 'MyCompany'
namespace. It will just be a wrapper Namespace which will wrap the actual
applications such as 'MyApplication1' and children. So do I need to create a
dummy project just to create a wrapper Namespace 'MyCompany' ?

Thanks again,
Don

"Ken Tucker [MVP]" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Greg Burns
Can't you just set the root to MyCompany.MyApplication1 ?

Greg

"Don Wash" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Don Wash
Yes, I could. But then again, I have to set this information to every
application I develop which is very redundant and really a pain when I need
to change company name.

Any other methods?

Thanks,
Don

"Greg Burns" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Scott M.
I do a lot of work with a Global insurance company that has a standard that
all applications will start with the company name followed by other company
specific information.

Developers are simply told that when they create a new project, set the root
namespace to Companyname.otherInfo.etc. It isn't really a big deal because
they are not making new projects every 2 seconds and it only takes 2 seconds
to set the root namespace.

"Don Wash" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Andy Becker
"Don Wash" <Click here to reveal e-mail address> wrote in message
news:%Click here to reveal e-mail address...
[Original message clipped]

That's pretty much the limit of your choices, I'm afraid. Nothing that
can't be handled with a good program editor's file search/replace
functionality - on those rare occasions when the company name changes. :-)

Best Regards,

Andy

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification