473,508 Members | 4,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Namespace best practice

Is it best to separate the layers within an app (for example business logic
layer) into separate .dlls or just use namespaces to logically divide the
app?
Nov 20 '05 #1
5 4222
Nak
> Is it best to separate the layers within an app (for example business
logic
layer) into separate .dlls or just use namespaces to logically divide the
app?


That's all a matter of personal preference. It is a good idea to seperate
parts of the application into DLL's, parts that are reusable and could be
used in other applications. For example, I have a DLL wich contains all of
my reusable classes and user controls, this way I can update the DLL and as
long as I don't change the interface I can *update* the application without
having to replace everything (Though I'm sure you knew that anyway).

It's a good idea to employ suitable name spaces too though of course, for
example my namespace root is my full name, and my application components
come under that.

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #2
Hello,

"Ed Crowley" <cu******@pacbell.net> schrieb:
Is it best to separate the layers within an app (for example
business logic layer) into separate .dlls or just use namespaces
to logically divide the app?


I would place them in separate DLLs.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3

"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:uZ**************@TK2MSFTNGP11.phx.gbl...
Hello,

"Ed Crowley" <cu******@pacbell.net> schrieb:
Is it best to separate the layers within an app (for example
business logic layer) into separate .dlls or just use namespaces
to logically divide the app?


I would place them in separate DLLs.


Thought so. I've read advice from MS saying to put everything into one .exe
for best performance, but I may want to use my business layer for a web
front-end, so I guess DLLs are the best way to go.

Thanks.
Nov 20 '05 #4
Ed,
In addition to Nak's & Herfried's comments I tend to use a combination of
both.

Some of my projects have multiple assemblies per layer, where there are
logical groupings within that layer. Also I tend to have one or two
'Framework' assemblies that are somewhat layer indifferent (they apply to
all layers or multiple layers).

The problem that tends to come into play is when two layers (in two
assemblies) both need to know about the other, which is where the Separated
Interface Pattern is handy.

http://www.martinfowler.com/eaaCatal...Interface.html

Hope this helps
Jay

"Ed Crowley" <cu******@pacbell.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is it best to separate the layers within an app (for example business logic layer) into separate .dlls or just use namespaces to logically divide the
app?

Nov 20 '05 #5
Thanks to everyone for the information!

"Jay B. Harlow [MVP - Outlook]" <Ja********@email.msn.com> wrote in message
news:O#**************@TK2MSFTNGP11.phx.gbl...
Ed,
In addition to Nak's & Herfried's comments I tend to use a combination of
both.

Some of my projects have multiple assemblies per layer, where there are
logical groupings within that layer. Also I tend to have one or two
'Framework' assemblies that are somewhat layer indifferent (they apply to
all layers or multiple layers).

The problem that tends to come into play is when two layers (in two
assemblies) both need to know about the other, which is where the Separated Interface Pattern is handy.

http://www.martinfowler.com/eaaCatal...Interface.html

Hope this helps
Jay

"Ed Crowley" <cu******@pacbell.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Is it best to separate the layers within an app (for example business

logic
layer) into separate .dlls or just use namespaces to logically divide the app?


Nov 20 '05 #6

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

Similar topics

6
2874
by: clintonG | last post by:
Microsoft recommends CompanyName.TechnologyName and it all comes down to not breaking the inheritence model if I am not mistaken. VSN2003 however tells the compiler to use the name of the project...
136
9201
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...
7
8422
by: thechaosengine | last post by:
Hi all, Can anyone tell me if it is advisable (or even possible) to define a namespace across 2 or more assemblies? For example, consider the namespace SampleApplication.Data.Providers ...
9
5394
by: Ivan Mascovich | last post by:
Previous posts (and compilers) confirm that class X { friend void Y() ; } ; does not match namespace
4
8055
by: Steph | last post by:
hello, can we do a partial namespace ? i want split my cs file (contain all my classes) in a lot of files and then compil their into my DLL... so in this case, is more easy to work : ...
12
2161
by: bgeneto | last post by:
I know that it's a very basic question, but I can't figure out or find an answer to why do we have to specify a namespace, like this #include<string> using namespace std; when using the...
1
7721
by: Paul | last post by:
Hello: I want to nlude this statement into everyone of my application's .aspx pages. <%@ Import Namespace="System.Data.SQLClient" %> What is the best practice to do this? Can I do this...
30
4064
by: Pep | last post by:
Is it best to include the code "using namespace std;" in the source or should each keyword in the std namespace be qualified by the namespace tag, such as std::cout << "using std namespace" <<...
2
3180
by: ryan_melville | last post by:
Hi, Should I put the operator<<() for my class (which is in a namespace) in the namespace or make it global? If I understand the lookup rules correctly: If I make it global, it may be hidden...
12
5380
by: Taras_96 | last post by:
Hi everyone, AFAIK external linkage allows you to refer to variables/functions outside of the current translation unit. A variable in an unnamed namespace is similar to declaring a static...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
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...
1
7058
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
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
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,...
1
5057
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...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.