Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Libs and DLLs in c#
Message
 
À
14/06/2007 00:39:43
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
01232514
Message ID:
01233168
Vues:
8
Sure you can do this but you probably shouldn't <s>. Especially in the scenario you describe because I assume there's actually a little bit of code involved in these custom controls.

Given that in VS you can create folders and break out classes into any structure you might need it seems like it makes a lot more sense to have separate files that you can easily identify vs. having to dig through 50 classes in a single file.

Then again pure preference, but also part of the .NET guidelines (which I make plenty of exceptions for myself though).

I tend to use 1 class per source file USUALLY but there are exceptions for things like enums, strcutures, delegates etc. that 'belong' to a specific class.

+++ Rick ---

>Another opinion ... I disagree on the "one class per .cs file" ... sorry Craig. I just don't think that should be a hard and fast rule by any means.
>
>We have a Controls.cs file that contains our base classes for a whole slew of controls. Things like TextBox, ComboBox, ListBox, ListView, etc.etc.etc. These sub-classes cannot be visually designed anyway, so putting a bunch of them all into one .cs file makes a lot of sense. I can't imagine having a MyTextBox.cs, MyComboBox.cs, MyListView.cs, etc.etc.etc. What a load of unnecessary files THAT would be! =0(
>
>Just my 2cents.
>
>~~Bonnie
>
>
>
>
>>No libs or objs... you use DLLs.
>>
>>One class per .cs file. Each project will get compiled into a separate DLL or EXE. You should logically group the .cs files, based on functionality, into their own project.
>>
>>>Just getting started with .NET and some C# projects. At this point I'm a total newb to c# and .NET, hopefully my questions don't sound too stupid.
>>>
>>>I have a few questions on library design so that I can get a better handle on how to properly layout an app.
>>>
>>>I notice when I create a Windows control library project it gets compiled into a DLL, I don't see an option to change this into an obj or lib or similar type file, are all c# libraries external dlls or can they be statically linked into the main file at compile time?
>>>
>>>Link may not be the right term here, but if you've worked in c you can probably figure out what I mean.
>>>
>>>I've also heard that putting too many objects/classes into a c# library can cause troubles, don't know if that is true, but curious if there is an optimum size or number of classes for a library?
>>>
>>>I'm still struggling to learn the basics, but I'd like to get my head around the overall layout of a larger app so that I don't have to go back and recode too many times as I progress. Any feed back is appreciated.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform