473,791 Members | 2,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Philosophical question about separating tiers

We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is it
worth it? With ClickOnce, publishing updates is now very simple. And, to
have the business components on a separate server, doesn't that necessarily
mean .NET Remoting (which adds complexity)? Or is there a simpler route to
be had? Are there more pros that I'm not thinking of?

Thanks,
Ron
Jun 28 '06 #1
5 1563
Ronald,

Tiers in an application are abstractions, they don't necessarily have to
be defined by a physical separation.

Have you asked your boss why he wants to move those classes to a
business server? What kind of benefit are you getting? Distributed calls
are not something that can just be wired up through remoting. The nature of
distributed applications is generally that you want to have large chunky
calls, instead of small, little calls. If you have a business object layer,
and you connect to objects on another server, it will probably be slower
than you expect (especially given that the server should handle the load
from all of your clients now). The reason for this is that you usually set
a good deal of properties on your objects before you actually do anything
with them. This will cause a number of remoting calls to occur.

In reality, you should be making one big call, passing all the property
values to be set.

Also, remoting is pretty much dead, with the advent of WCF in .NET 3.0.
Remoting doesn't have the support for authentication, authorization,
transactions, queued messages, etc, etc that WCF does. I really couldn't
recommend it in good faith given what is on the horizon.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Ronald S. Cook" <rc***@westinis .com> wrote in message
news:eC******** ******@TK2MSFTN GP05.phx.gbl...
We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is
it worth it? With ClickOnce, publishing updates is now very simple. And,
to have the business components on a separate server, doesn't that
necessarily mean .NET Remoting (which adds complexity)? Or is there a
simpler route to be had? Are there more pros that I'm not thinking of?

Thanks,
Ron

Jun 28 '06 #2
I suggest you read Lhotka's book on the CSLA framework. It gives in-depth
examples of how easy it is to implement a separate physical tier using
remoting. Another option is to expose your classes via XML Web Services
(asmx files in a ASP.NET application).

"Ronald S. Cook" wrote:
We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is it
worth it? With ClickOnce, publishing updates is now very simple. And, to
have the business components on a separate server, doesn't that necessarily
mean .NET Remoting (which adds complexity)? Or is there a simpler route to
be had? Are there more pros that I'm not thinking of?

Thanks,
Ron

Jun 28 '06 #3
A few other benefits that you do not mention here are security and
scalbility.

If you are pushing your business objects/data access code to every machine
every machine will be accessing the database. This obviously brings up some
scalability issues as you get into many clients.

There is also a security issue here as all of these machines need to be able
to contact the SQL server. By putting this to a remote system, only that one
machine needs to be able to contact the SQL server (so you have further
isolated the SQL Server from possibility of attack).

Further security arguments exist due to the ease of disassembling code
(introducing your own code) on the client side. By placing the business
logic on its own server you can host code there knowing it is in a
controlled environment.

Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung
"Ronald S. Cook" <rc***@westinis .com> wrote in message
news:eC******** ******@TK2MSFTN GP05.phx.gbl...
We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is
it worth it? With ClickOnce, publishing updates is now very simple. And,
to have the business components on a separate server, doesn't that
necessarily mean .NET Remoting (which adds complexity)? Or is there a
simpler route to be had? Are there more pros that I'm not thinking of?

Thanks,
Ron

Jun 28 '06 #4
Ron,

I'll echo another posters suggestion to look into the book Expert C#
Business objects (there's a second edition which targets .net 2.0, the
first edition is for .net 1.1). There is a huge advantage to splitting
up your application into tiers which can also be physically seperated.
One of those is scalability. The second is that you can easily build
new UIs which reuse the same business level code. So when you need to
go to WPF in the next few years, you won't have to throw out some or
most of your application (it depends on how tightly coupled your
business logic is to your current UI). By providing seperate physical
tiers, you ensure that you aren't 'mixing' business logic, UI and data
access. Csla provides a great framework to build your business
applications on (and if you do, you'll be able to easily use .Net
databinding for building out your UI).

HTH
Andy

Ronald S. Cook wrote:
We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is it
worth it? With ClickOnce, publishing updates is now very simple. And, to
have the business components on a separate server, doesn't that necessarily
mean .NET Remoting (which adds complexity)? Or is there a simpler route to
be had? Are there more pros that I'm not thinking of?

Thanks,
Ron


Jun 28 '06 #5
Whether your business classes exist in the client or on the server, the fact
is that if the database or data store is on a server somewhere, the client
still has to access the data remotely. That is, the data must get to the
client in order for the client to present it to the user.

Separation of business logic and UI logic is logical, as the same data may
be presented in various ways using various interfaces. However, that
separation is not physical (as Nicholas pointed out), but in a sense,
abstract. Yes, the classes should reside in separate DLLs, so that they can
be used in other applications. Does putting them on a separate machine
enhance the application? Probably not.

Changes in an application generally percolate upward from the data layer to
the UI layer. That is, if the data layer changes, as the business objects
are clients of the data layer, it is possible that they will have to change.
If the business layer changes, the client, being a client of the business
layer, may have to change. But good separation prevents having to change the
"lower" tiers when changes are made in the "upper" tiers.

The consequences of putting your business classes on a single server are
many, and may be both good and bad. In a single-client UI environment, the
logic is encapsulated in an environment in which it doesn't have to keep
track of which client it is doing work for. When a single server object
services many clients, complexity ensues. The business tier must then keep
track of which client is doing what, and it must perform a large varety of
tasks for a large number of clients concurrently, thus adding complexity to
the application. This also affects performance, as a single instance of the
business logic is now serving many client applications. In essence, when you
put the business classes into a server environment, all handling all clients
at one time, you must add another layer, a "client interface" layer, to
manage all of the clients. The greatest benefit is that there is only one
copy of the code in one location. But, as you have pointed out, there are
plenty of ways to publish changes (new versions of DLLs) to multiple client
interfaces, such as ClickOnce.

In conclusion, I would have to say that, unless one is developing a
deliberately thin-client application (such as a web application) for the
reasons that thin-client applications exist, the only real requirement that
makes sense is to put the data store in a single location, as that is shared
by all clients, and that is what must be coordinated between all clients.
Putting the business logic into a single location is more likely to be
counter-productive than beneficial.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Big thicks are made up of lots of little thins.
"Ronald S. Cook" <rc***@westinis .com> wrote in message
news:eC******** ******@TK2MSFTN GP05.phx.gbl...
We have a Windows app which contains UI code and all classes that perform
business logic and make calls to database stored procs (located on a
database server - i.e. not local to the app).

My boss wants to bring all those classes to a business server and out of
each instance of the Windows application (i.e. separate into a business
tier).

I understand that by having the business tier separate from the user tier,
we can make changes without having to republish the application. But is
it worth it? With ClickOnce, publishing updates is now very simple. And,
to have the business components on a separate server, doesn't that
necessarily mean .NET Remoting (which adds complexity)? Or is there a
simpler route to be had? Are there more pros that I'm not thinking of?

Thanks,
Ron

Jun 29 '06 #6

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

Similar topics

28
3308
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are a number of aspects to this simplification, but for me the unification of methods and functions is the biggest benefit. All methods look like functions (which students already understand). Prototypes (classes) look like modules. This will...
77
5696
by: nospam | last post by:
Reasons for a 3-tier achitecture for the WEB? (NOTE: I said, WEB, NOT WINDOWS. DON'T shoot your mouth off if you don't understand the difference.) I hear only one reason and that's to switch a database from SQL Server to Oracle or DB2 or vice versa... and that's it.... And a lot of these enterprises don't need it as they already know what database they are going to use and they don't plan on switching in and out database in the first...
11
3627
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected: virtual void do_bar() {} };
8
2009
by: Steve Jorgensen | last post by:
Hi folks, I'm posting this message because it's an issue I come up against relatively often, but I can't find any writings on the subject, and I haven't been able to figure out even what key words one would use to look for it. First, in broad philosophical terms, code actually -is- data. Code is the data that's fed into a compiler, interpreter, or microprocessor that tells it what to do. Code execution is, then, just a form another...
3
1525
by: mca | last post by:
Hi everyone, I'm new to asp.net and i have a question about separating the html code from the programming code. i have an unknown numbers of entries in my table. I want to make a hyperlink for every entry in my table. So i query the database and get for example 3 entries back. So in a while loop i can make 3 hyperlinks with response.write(.......) etc.
1
1096
by: ken | last post by:
Dear all does any recommend books for develop middle tiers for .ne recently, i develop asp.net only aspx/dll, database , two tier and vb.net only frm/dll, database, two tiers
4
2363
by: Madhav | last post by:
Hi all, I am a newbie in c++. I want to know what is the philosophical reason behind the existence of friend functions. I thought giving access to private data to a function which is not a member of the class is a violation of encapsulation. Thanks, Madhav.
8
3079
by: Henrik Dahl | last post by:
Hello! In some situations I have a collection of objects which it in different situations could be relevant to deal with at the UI-tier and sometimes at other tiers. Typically my concept is a composite so MyCollectionElementClass has a collection of MyCollectionElementClass. Should I make one implementation for the UI-tier using ObservableCollection(MyCollectionElementClass) and one for the non-UI tier using...
35
1925
by: rebeccatre | last post by:
hi can Variant archiving setTimout('.. capability be done without using it? :-)
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.