Chapter 5. Code Reusability in ASP.NET

So far in this book, we’ve built complex pages that employ sophisticated DataGrid and interoperable controls. Although the .NET Framework is a slim and elegant hierarchy of classes for building Web projects, many of you will end up with unwieldy blocks of code and layout information, and when the complexity of a software component grows beyond a certain threshold, reusability and encapsulation become serious issues. Years ago, someone coined a phrase to describe this programming phenomenon: spaghetti code.

Originally, spaghetti code referred to the messy tangle of lines of BASIC that resulted from unsparing use of GOTO statements and a modular programming style. It’s also an apt description of unstructured, ...

Get Building Web Solutions with ASP.NET and ADO.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.