Ask a Question related to ASP.NET General, Design and Development.
-
Craig Deelsnyder #1
Re: Best Practices - solution - namespaces - classes
I would say that the projects should be divided logically into reusable
units, not too big, not too small. Most times, most of your projects are
built into a class library, which is a .dll that someone else can use in
their project, or know is in the GAC, etc. You want to structure them
logically, whatever makes the most sense. Most often you'll have a security
library (project/dll), data access library, etc., as these are components
most other projects need, and is the logical unit they'd borrow at.
Then all you have left are the actual projects that are your applications.
They use these class libraries you've already built.
My opinion is that there should only be one class per file. It's an old
habit from Java, and makes it easier to navigate thru your code.
And yes, everything should go into a namespace, which can also be set at the
project level. But I recommend another old Java habit, of having all
namespaces start with your company's internet domain name backwards...if you
are company ABC at abc.com (just pretend :-) ), then all packages from your
company should be named
com.abc.security
com.abc.apps.app1
com.abc.....
etc. This way, if you ever distribute your library, you're almost assured
it will have a unique namespace. Don't know if this practice ever caught on
in .NET, but it was the way we did it when I used to do Java....
HTH, just some ideas....
--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
"Vincent V" <vincentv@-n0-5pam-optushome.com.au> wrote in message
news:OXKtjNbWDHA.3232@tk2msftngp13.phx.gbl...ms> Hey i am just starting a new project
> and from the start i want to make sure my app is as Object Orientated as
> possible
>
> I have a couple of questions in relation to this
>
> Question 1:
> Should i Struction my solution in numerous projects ie
> 1. Webpage Files(ui)
> 2. Classes
> 3. Web Services
> 4. Mobile Pages
>
> Question 2:
> How should i structure my classes
> Should i have many .vb class files with one Class in each vbfile
> Should i put many related Classes in one vbfile
> Should i structure all my class files into namespaces
>
> Question 3:
> Any one have any good info related to .net best practices(apart from the> practice docs)
> ANy one have any info on best css practices
>
> Thanks
>
>
>
Craig Deelsnyder Guest
-
Web services and namespaces
Hi. VS.NETO help says the following about the webservice attribute: "The WebServiceAttribute is not required for an XML Web service to be... -
Creating XML object with namespaces
I'm trying to create the following XML <xs:schema id='MySchema' xmlns:xs='http://www.w3.org/2001/XMLSchema'... -
How does a DLL change namespaces?
My ASP.NET web service runs fine on my local PC, and it has the namespace that I gave it. But when I upload it to my hosting company I get this... -
RubyDotNet r4 and namespaces
I grabbed the r4 release of RubyDotNet from http://www.saltypickle.com/rubydotnet, and it works great (well, on my laptop. My main PC seems to... -
Duplicate Namespaces
When I include a class (MasterData : DataSet), as a return type or an OUT argument in a Web Service I get an error "Duplicate namespace, , ". when... -
Vincent V #2
Best Practices - solution - namespaces - classes
Hey i am just starting a new project
and from the start i want to make sure my app is as Object Orientated as
possible
I have a couple of questions in relation to this
Question 1:
Should i Struction my solution in numerous projects ie
1. Webpage Files(ui)
2. Classes
3. Web Services
4. Mobile Pages
Question 2:
How should i structure my classes
Should i have many .vb class files with one Class in each vbfile
Should i put many related Classes in one vbfile
Should i structure all my class files into namespaces
Question 3:
Any one have any good info related to .net best practices(apart from the ms
practice docs)
ANy one have any info on best css practices
Thanks
Vincent V Guest



Reply With Quote

