Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How much is too much?
Message
 
To
27/02/2007 09:23:51
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
Miscellaneous
Thread ID:
01199105
Message ID:
01199800
Views:
12
Mike,

It really depends, but from what you're describing (and if you're not exaggerating) it might indeed be a bit much.

I've found with all the craze in Refactoring in Agile technology people are highly adverse to methods that are longer than a few lines of code and classes that have more than a few methods. In this methodology you can easily run into scenarios you describe. I'm not a fan of this for precisely the reasons you mention. While it might be easier to test such a system and it 'follows current agile standards' in many cases the code is a bitch to understand, follow and actually debug.

Abstraction is a good thing but too much quickly becomes a problem <s>...

As Bonnie mentioned I also agree that a good business layer should limit the levels that you walk through in a debug cycle. In my business layers a typical step through all the way to data access is:

GUI Code (web or winform)
Application Business Object (could be potentially multiple steps here)
Base business object code for high level data access
DAL code for low level data access

In all of this typically 4 files would be open (although actual method steps may be deeper). Now obviously your application logic in GUI and Application logic can and often is more complex, but still it shouldn't be too deep because generally speaking most application level logic is not highly reusable or abstractable. If you abstract too much of it it's often never used <s>...

But again, it all depends on the complexity of the application.

Another thing to remember is that if you can you should possibly remove your business and data layer projects, so that you don't step into that code. These libraries should throw errors or results back to your Application layer and so there's really no need to step through this code unless you are the architect of that code... This should reduce the complexity significantly.

Hope this helps,

+++ Rick ---



>I am doing some maintenance on an ASP.NET app. The app is split into 3 tiers and is extremely object-oriented. I wanted to see the logic used when added line items to a detail section, so I set a breakpoint in the Page_Load event. To help understand the flow, I closed all open documents in my IDE except for this webform and its code page.
>
>About 250 Step Into's later, I hit my first call to the DAL. There are now about 40 files open that I had to step through. There's no real magic going on here... just a simple call to the database and displaying records. It probably could have been done in under 50 lines. I still haven't answered my initial question.
>
>Is a situation like this normal in the real world, or did the developer before me have way too much time on his hands to program (and not enough to document)?
>
>When does sophisticated and powerful code cross the "not easy to maintain" line?
>
>I usually try not to criticize other people's code as I know I have a lot to learn yet, and I have learned a lot from this previous developer, but I have spent way too much time trying to fix a few small issues.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform