473,944 Members | 3,679 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.c s is instantiating a new object
and calls obj1.COBdateIni t().
obj1 does exactly the same thing.
It call obj2.COBDateIni t()
obj2 does the same thing again, it call obj3.COBdateIni t()
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 956
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,Sca lar) 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**@discussio ns.microsoft.co m> wrote in message
news:C5******** *************** ***********@mic rosoft.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.c s is instantiating a new object
and calls obj1.COBdateIni t().
obj1 does exactly the same thing.
It call obj2.COBDateIni t()
obj2 does the same thing again, it call obj3.COBdateIni t()
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
6853
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 these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
8
11110
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 layers, that get visible when something is clicked. All works fine. Problem:
8
2585
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 an alternative to pop-up windows in a web page. The code I have works (sort of). The problem is that I can move these layers around when I move the mouse slowly, however, if I move it fast the web browser looses track of the motion and leaves the...
2
5931
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 (document.getElementById(what).style.display == "none") { document.getElementById(what).style.display = "";
1
1742
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 see a list of all the the people in your address book whos last names start with "d". Type another letter "e" for example and the list is narrowed to people who's names start with "de". etc etc.
4
3130
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. This is a link to a very simple page that contains 2 DIV statements: http://xsinx.no-ip.com:8880/TestEmbedDiv.html One of them is embeded in the other. There is some clipping involved (the red layer is smaller than the yellow one). If you look at...
25
2240
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 example and I managed to understand the data layer only. Is for example web services and their consumption an instance of n-tier, covering the business and presentation layers?
4
1279
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 you can imagine as it is getting bigger it is harder to maintain. We would really like to pull the business logic into class objects but I am stuck on the concept. Today the web front end reacts to events and makes web service calls. The web...
3
1305
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 other. The first type is the DAL described in this MSDN article as well as in the tutorial on the www.asp.net website: http://msdn2.microsoft.com/en-us/library/ aa581778.aspx#aspnet_tutorial01_dataaccesslayer_vb_topic3
0
10147
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11136
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...
1
11310
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10677
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
9870
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
7399
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
6093
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3520
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.