473,508 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

3 layers that do nothing except calling each other

Hi,
I was given an ASP.NET (C#) application to modify.
The code looks really strange.
It's supposed to do simple things but it has
Facade/BusinessRules/Common/DataAccess layers.
For example,
simple method in Navigate.ascx.cs is instantiating a new object
and calls obj1.COBdateInit().
obj1 does exactly the same thing.
It call obj2.COBDateInit()
obj2 does the same thing again, it call obj3.COBdateInit()
and that one retrieves data.

Is it OOP? Why not to get data at the first step?
Isn't it an overkill?

Thanks,
RO

Mar 1 '06 #1
2 942
Hi Riga,

It is difficult to judge if the structure is in this case overkill, but
judging from the example you gave this might be the case here. Because
why does the facade need to call a method that is present 3 layers deep?
The presentation layer should not be bothered how a certain object
that is only used by the data access layer is initialized.

Let's assume it's bad design, your still are asked to modify the
application. A good start might be to read "Working Effectively With
Legacy Code" (see link below). As re-writing is most of the times not
very pragmatic it's good to know how to deal with legacy code when you
need to change it.

http://www.objectmentor.com/resource...LegacyCode.pdf

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
Mar 1 '06 #2

Tiered development and OO are 2 different things.

I do not think your code is circular, because circular references usually
bomb out.

Presentation calls the BusinessLayer
BusinessLayer calls the DataLayer
DataLayer returns something (DataSet, IDataReader, Scalar) to the
BusinessLayer.
BusinessLayer uses the return object(DataSet,IDataReader,Scalar) to do
something usually. (Create a collection, check values, sometimes it just
shoots the DataSet up to the Presentation layer)
Presentation Layer "presents" the thing it got from the BusinessLayer.

Sometimes developers use the same names for the method calls.

I wouldn't un-architect this....until you understand what it does..and if
they are perhaps just using a decent 3tier design.

...

"riga" <ri**@discussions.microsoft.com> wrote in message
news:C5**********************************@microsof t.com...
Hi,
I was given an ASP.NET (C#) application to modify.
The code looks really strange.
It's supposed to do simple things but it has
Facade/BusinessRules/Common/DataAccess layers.
For example,
simple method in Navigate.ascx.cs is instantiating a new object
and calls obj1.COBdateInit().
obj1 does exactly the same thing.
It call obj2.COBDateInit()
obj2 does the same thing again, it call obj3.COBdateInit()
and that one retrieves data.

Is it OOP? Why not to get data at the first step?
Isn't it an overkill?

Thanks,
RO

Mar 2 '06 #3

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

Similar topics

6
6824
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of...
8
11088
by: Freek te Water | last post by:
Hi, Hope no-one is offended by my probably noob question... Context: I have a web page design, which always centres in the middle of the screen (using a 100%*100% HTML-table). Now I also use...
8
2539
by: rdlebreton | last post by:
Hi, Folks! I've been trying to develop my own version of these draggable layers and I have been limiting myself to IE6...for now. I have looked at some other examples to get ideas of creating...
2
5910
by: leemundie | last post by:
Hi, Thanks for any help in advance I'm using the following JS to drop/show content that is hidden: function expandDiv(tahw) { what = tahw + "_menu" if...
1
1708
by: engwar | last post by:
Not really sure how to ask this. I'm new to CSS/DHTML I want to create something similar to how yahoo and gmail handle the "to" field when you type an email. If you start typing "d" you will...
4
3109
by: zz | last post by:
Sorry for posting this here but unfortunatly I couldn't find any appropriate newsgroup for this and since I've been active here with .net question I figured you guys might be able to help. ...
25
2187
by: Dan Aldean | last post by:
Hello, I try to understand how the business and presentation layers would practically translate into programming reality. I read lots of articles about 3-tier, but none of them gave a practical...
4
1253
by: Steve Y. | last post by:
Hi, I need some input to help my thinking process. We have a multi layer web application now but we didn't do a very good job separating the business logic from the user interface logic. So as...
3
1278
by: kbutterly | last post by:
Good morning, I have seen two different types of data access layers and I am wondering which, if either, is considered best practice, or if one is better suited to certain situations than the...
0
7231
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
7133
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
7336
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
7504
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
5643
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
5059
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
4724
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...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
773
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.