Best Practices - solution - namespaces - classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vincent V

    #1

    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



  • Craig Deelsnyder

    #2
    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.securit y
    com.abc.apps.ap p1
    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.a u> wrote in message
    news:OXKtjNbWDH A.3232@tk2msftn gp13.phx.gbl...[color=blue]
    > 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[/color]
    ms[color=blue]
    > practice docs)
    > ANy one have any info on best css practices
    >
    > Thanks
    >
    >
    >[/color]


    Comment

    Working...