CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeffrey Palermo (.com)

Blog moved to www.jeffreypalermo.com

ASP.NET apps - things of utmost importance - level 200

I've inherited an ASP.NET application that evolved as it went, and my task is jump in and continue to enhance it. In order to do that, I've found that I need to refactor it in order to sustain its development. As it is now, it will continue to be a large, unmaintainable beast. The most important thing I'm doing is taking parts that are repeated and refactoring them into controls. This app was made with aspx pages as the focal point, and I'm refactoring to focus on controls. My goal is to enable a new page to be constructed by simply adding the appropriate controls. I don't want any code in the code behind of pages except for a property setting or method call on child controls. It's a lot easier to test custom controls than it is pages. Plus, it leads to a more maintainable site. For those reading: if you aren't comfortable with custom controls, then put everything inside user controls. You will still get the benefits of reuse and encapsulation. My rule of thumb for pages is if I have to scroll to see all the markup, then it's too much, and I'm going to refactor to controls. I'm a little more relaxed with this rule for user controls because they can be reused, but I'm firm about pages. Less is more. One quick note: I'm not doing RAD (disposable) software, and I rarely use the designer, so my rules apply to a more sustainable software paradigm, but they make no sense in a RAD environment [not many things do :)].


Comments

shebert said:

Do you commonly find the need to monitor/work with UI developers to make certain they aren't duplicating code all over the place?
# June 28, 2005 7:18 AM

shebert said:

oops, i hit submit too soon...

I think there's something to the notion that UI has its own 'architecture' within the system. And if it's not constantly questioned and refactored you end up unmaintainable code.



# June 28, 2005 7:22 AM

Jeffrey Palermo said:

Absolutely. I came into this project with a website already in place. I'm the ASP.NET SME here now, so I now own the ASP.NET layer. If I didn't police it, then others would code how they are comfortable (and novices to ASP.NET are comfortable with something just working). There are great SQL folks, and great class library folks, but they may be clueless about ASP.NET. It's like they just instinctively fall back into procedural mode with anything that involves markup.
# June 28, 2005 9:11 AM

About Jeffrey Palermo

Jeffrey Palermo is a software management consultant and the CTO of Headspring Systems in Austin, TX. Jeffrey specializes in Agile coaching and helps companies double the productivity of software teams. Jeffrey is an MCSD.Net , Microsoft MVP, Certified Scrummaster, Austin .Net User Group leader, AgileAustin board member, INETA speaker, INETA Membership Mentor, Christian, husband, father, motorcyclist, Eagle Scout, U.S. Army Veteran, and Texas A&M University graduate. Check out Devlicio.us!

Our Sponsors

Free Tech Publications

This Blog

Syndication

News

Headspring Systems

View Jeffrey Palermo's profile on LinkedIn

See my new blog at .jeffreypalermo.com