473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

question about best practices


Ive been trying to get an answer on this for a while but I can't seem to get
a clear answer.

If I want to use external c# classes, accessed from my codebehind page, what
is the best way to set that up?

Currently I have the following setup.

-Shared hosting that supports asp.net
-Im placing assembly DLL's I created from my c# classes in my bin directory.
One per *file* currently. In otherwords, one file can have several classes
in it, although all are in the same namespace.

I would like to have one class per file, as in Java.

Question: Should I compile each class into its own assembly, or is there a
better way. E.G. - multifile assembly, or...?

TIA
Karl
--
you know when you think you know something
and then you realize you know nothing
Nov 18 '05 #1
3 842
I've found that Visual Studio's way of organising classes and DLLs is quite good. From your post I assume you have not used VS before. This is how you would replicate the same structures. Have your root folder, and have sub forlders for each unique 'Project' or Module of your application. Put all your classes as individual files (one file per class) in each relevant sub-directory.

Visual Studio creates an assembley DLL per 'Project' or module and puts it in a sub-directory called 'bin' under the owning module sub-directory, i.e.:

RootFolder\Module1\bin\Module1Assembley.dll
RootFolder\Module2\bin\Module2Assembley.dll

This seems a logical way to do things as usually a single 'Project' or module usually represents a single 'Business Unit', if I can call it that; a logically related set of classes. This way you can re-use the the assembley DLLs in other applications if required. This is can be done if you don't have Visual Studio.

Or better yet just get Visual Studio :)

Rasika Wijayaratne
Nov 18 '05 #2
"Rasika Wijayaratne" <ra**********@luckymail.com> wrote in message
news:22**********************************@microsof t.com...
I've found that Visual Studio's way of organising classes and DLLs is quite good. From your post I assume you have not used VS before. This is how
you would replicate the same structures. Have your root folder, and have sub
forlders for each unique 'Project' or Module of your application. Put all
your classes as individual files (one file per class) in each relevant
sub-directory.
Visual Studio creates an assembley DLL per 'Project' or module and puts it in a sub-directory called 'bin' under the owning module sub-directory, i.e.:
RootFolder\Module1\bin\Module1Assembley.dll
RootFolder\Module2\bin\Module2Assembley.dll

This seems a logical way to do things as usually a single 'Project' or module usually represents a single 'Business Unit', if I can call it that; a
logically related set of classes. This way you can re-use the the assembley
DLLs in other applications if required. This is can be done if you don't
have Visual Studio.
Or better yet just get Visual Studio :)

Rasika Wijayaratne


Thanks, I actually looked at the iBuySpy application example and found the
batch script to compile all the classes into one dll. Same thing you said
basically, but I needed a command line example. If anyone's interested mine
looked like this:

csc /t:library /out:SiteLib.dll SiteController.cs PostBackReceiver.cs
FileManager.cs XMLEditor.cs MenuCommand.cs XPathUtil.cs

As a side question, I would like to get visual studio. Whats your opinion on
getting it as an msdn subscription, or buying it alone.

TIA
Karl
Nov 18 '05 #3
Standard edition is fine for general development (about USD100). It has great support for winforms and webfroms apps and the rest of the apps supported by other editions. The startup projects are just code skeletons after all, so you can do pretty much any project type with standard editions, even once that are not in the New dialog (i.e. your own project types)

However .NET Compact Framewrok is only available with Professional ed and above. Also don't know if DirectX (managed) will work with standard ed

Rasika Wijayaratne
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: byrocat | last post by:
I'm chasing after a documetn that was available on one of the Microsoft websites that was titled somethign like "MS SQL Server Best Practices" and detailed a nyumber of best practices about...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
3
by: Derek Martin | last post by:
Hi list, I have been doing VB.Net for quite a while now and just now getting into the forray of ASP.Net using VS2003. I have created our development website and now we are ready to start putting...
2
by: Amelyan | last post by:
Could anyone recommend a book (or a web site) that defines best practices in ASP.NET application development? E.g. 1) Precede your control id's with type of control btnSubmit, txtName, etc. 2)...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
7
by: Rhino | last post by:
I thought I'd take a second to step away from a specific problem and ask a general question about best practices; I know some of the people here are very experienced with CSS. Given the need to...
10
by: Ren | last post by:
Hi All, I'm still rather new at vb.net and would like to know the proper way to access private varibables in a class. Do I access the variable directly or do I use the public property? ...
4
by: Maciek | last post by:
I've got this question regarding programming and design practices. I'm designing Newsletter module for my WebApp and I'm greenhorn in programming. There's a stored procedure which adds a...
3
by: John Dalberg | last post by:
I am looking for an ASP.NET application on CodePlex which exemplifies best practices for the following: - Use of interfaces - Seperation of the UI, business and data tiers - Data Tier that uses...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.