Click here to Skip to main content
15,884,975 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
PIEBALDconsult27-Dec-11 4:56
mvePIEBALDconsult27-Dec-11 4:56 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
Shameel27-Dec-11 5:09
professionalShameel27-Dec-11 5:09 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
PIEBALDconsult27-Dec-11 5:30
mvePIEBALDconsult27-Dec-11 5:30 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
#realJSOP27-Dec-11 7:37
mve#realJSOP27-Dec-11 7:37 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
Shameel27-Dec-11 8:02
professionalShameel27-Dec-11 8:02 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
PIEBALDconsult27-Dec-11 8:28
mvePIEBALDconsult27-Dec-11 8:28 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
Jan Steyn28-Dec-11 2:08
Jan Steyn28-Dec-11 2:08 
AnswerRe: how can we write large source code in 2 or more seperate units? Pin
BillWoodruff27-Dec-11 5:14
professionalBillWoodruff27-Dec-11 5:14 
I think another way to "frame" this question ... if my intuition is on-line here ... is to ask: how can I design, or re-design, my getting-very-big project into functional units, or: how can I determine a set of "organic criteria" which to use as an "organizing principle" to divide my project into logical "chunks" which, in the long run, contribute to program extension, maintenance, and de-bugging (and lend themselves to unit-testing in "isolation" ?).

All the "tools" mentioned here, including "Partial Classes," "Class Libraries," etc. are valuable.

... edit in appreciative response to feedback from PiebaldConsult ...

Please note: in Visual Studio the option to create a "Class Library" is one that appears when you create a new Solution, and also appears as an option when you choose to add a "New Project" to an existing "Solution." The question of whether a "Solution," which "begins life" as "only" a "Class Library," is, semantically, a "Solution," or a "Project" ... we'll we won't touch that one ... Smile | :)

... end edit ...

You create it, compile it, and, then, to use it "externally," you must reference it, by adding a Reference to the compiled .dll via the Solution Explorer/ References / Add Reference facility. The location of that compiled .dll can be anywhere: and the Add Reference dialog will let you browse to find it.

Once the Reference is added: you do not need to have a 'using' statement for it to be accessed.

The one "tool," not mentioned here, that may also be useful in "encapsulating functional units,"
is using NameSpaces: within one solution you can add Classes, etc., and encapsulate them in the scope of a different NameSpace.

In that case, to access the "whatever inside" that NameSpace, you will need to have a "using" statement in your Form or whatever it is that requires access. Or, you can avoid having a "using," statement kby using a "fully qualified" reference: Example:

C#
using SpecialNameSpace;

// now you can reference a class in SpecialNameSpace directly:

SpecialClass theSpecialClass = new SpecialClass();

// or ... without the "using" statement:

SpecialNameSpace.SpecialClass theSpecialClass = new SpecialNameSpace.SpecialClass();


However, when your solution, with multiple NameSpaces, is compiled, the resulting .exe incorporates everything: no separate files are created just by using different NameSpaces.

I have never experimented with trying to import a compiled class library dll into another class library, but, come to think of, I think I will Smile | :) ~
"It is the mark of an educated mind to be able to entertain a thought without accepting it." Aristotle

GeneralRe: how can we write large source code in 2 or more seperate units? Pin
PIEBALDconsult27-Dec-11 5:34
mvePIEBALDconsult27-Dec-11 5:34 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
BillWoodruff27-Dec-11 6:18
professionalBillWoodruff27-Dec-11 6:18 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
#realJSOP27-Dec-11 7:37
mve#realJSOP27-Dec-11 7:37 
GeneralRe: how can we write large source code in 2 or more seperate units? Pin
BillWoodruff27-Dec-11 15:46
professionalBillWoodruff27-Dec-11 15:46 
QuestionReading text using iTextSharp Pin
NarVish26-Dec-11 22:42
NarVish26-Dec-11 22:42 
Questionremoving checkboxes for bool datatypes in DEVEXPRESS grid view Pin
MahaKh26-Dec-11 9:59
MahaKh26-Dec-11 9:59 
AnswerRe: removing checkboxes for bool datatypes in DEVEXPRESS grid view Pin
Richard Andrew x6426-Dec-11 11:18
professionalRichard Andrew x6426-Dec-11 11:18 
AnswerRe: removing checkboxes for bool datatypes in DEVEXPRESS grid view Pin
AmitGajjar26-Dec-11 19:10
professionalAmitGajjar26-Dec-11 19:10 
QuestionHow to add large icon for my app Pin
skylarkcob26-Dec-11 3:13
professionalskylarkcob26-Dec-11 3:13 
AnswerRe: How to add large icon for my app Pin
Shameel26-Dec-11 3:54
professionalShameel26-Dec-11 3:54 
QuestionOOP Advice Pin
Natepizzle24-Dec-11 23:28
Natepizzle24-Dec-11 23:28 
AnswerRe: OOP Advice Pin
#realJSOP25-Dec-11 1:01
mve#realJSOP25-Dec-11 1:01 
GeneralRe: OOP Advice Pin
Natepizzle25-Dec-11 9:30
Natepizzle25-Dec-11 9:30 
AnswerRe: OOP Advice Pin
PIEBALDconsult25-Dec-11 4:36
mvePIEBALDconsult25-Dec-11 4:36 
GeneralRe: OOP Advice Pin
Natepizzle25-Dec-11 9:33
Natepizzle25-Dec-11 9:33 
GeneralRe: OOP Advice Pin
PIEBALDconsult25-Dec-11 9:57
mvePIEBALDconsult25-Dec-11 9:57 
AnswerRe: OOP Advice Pin
Luc Pattyn25-Dec-11 11:36
sitebuilderLuc Pattyn25-Dec-11 11:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.