Maximizing ASP.NET: Real World, Object-Oriented Development View Larger Image | Jeffrey Putz Addison-Wesley, Paperback, Published March 2005, 309 pages, ISBN 0321294475 | List Price: $44.99 Our Price: $28.50 You Save: $16.49 (37% Off)
| | | Availability: Out-Of-Stock |
Read an excerpt:
Chapter 5: Object-Oriented Programming Applied: A Custom Data Class
Excerpt provided courtesy of Addison-Wesley Professional. Copyright © Addison-Wesley. Written permission from the publisher is required for any use of this material.
|
Customer Reviews: 1 Average Customer Rating:      Write a Review and tell the world about this title! People who purchase this book frequently purchase: - Effective C#: 50 Specific Ways to Improve Your C#; Bill Wagner, $34.50, 37% Off!
- Practical Guidelines and Best Practices for Microsoft Visual Basic and Microsoft Visual C# Developers; Francesco Balena, et al, $31.50, 37% Off!
- Expert ASP.NET 2.0 Advanced Application Design; Dominic Selly, et al, $53.50, 24% Off!
- A First Look at SQL Server 2005 for Developers; Bob Beauchemin, et al, $31.50, 37% Off!
Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:
Preface
Microsoft has endowed Web developers with a gift. Since its introduction in
beta form to the masses in 2001, the .NET Framework and its ASP.NET subset have
changed the way we look at building Web applications. Indeed, before this time,
many of us didn't even think in terms of "applications," but rather
collections of loosely related scripts that together formed a Web site.
Making this transition required a serious leap of faith and a great deal of
new learning for a lot of developers. Scripting languages such as ASP 3.0, ColdFusion,
and PHP made it fairly easy for someone with little or no programming experience
to quickly learn about the platform and start building dynamic Web sites. Years
of experience as a developer or an academic background in computer science were
not necessary.
That background still isn't necessary, but with ASP.NET, the script developer
needs to make some fairly radical changes in his thinking to get the most out
of this amazing platform. This book aims to help you with that transition, or
get you familiar with the platform's architecture if you're well-versed in object-oriented
design.
Why Was This Book Written?
In watching the various message boards and newsgroups around the Internet,
it became clear that there are a lot of very smart developers having some problems
making the transition to the object-oriented world of ASP.NET. As much as we
praise Microsoft for delivering the platform to us, we can also curse them for
making it so inviting and safe because it doesn't force you to follow the "best
practices" they envisioned. You can do things in almost the same way you
did when you were using a scripting platform.
It would be easy to create a straight book on techniques or a "cookbook"
of sorts to help you along, but what I'm really after is a guide that helps
you understand the underlying concepts and architecture to the platform, so
you can apply the same concepts to your own applications. Indeed, I point out
in the second chapter that the code you write isn't any different than the code
that Microsoft wrote into the thousands of existing .NET base classes. A cookbook
or overview wouldn't help you in this understanding.
This book is not meant to evangelize object-oriented techniques. The idea is
to show you enough rationale behind the concepts to encourage you to use them.
I want light bulbs to go off in your head that say, "Oh yeah, I get it!"
Using OOP just for the sake of doing so is not a very good reason.
Who Is This Book For?
This book assumes that you've already taken the first steps in learning about
ASP.NET and have a relatively basic grasp of either the C# or Visual Basic .NET
languages. It is also assumed that you have some basic understanding of how
to use Microsoft SQL Server and understand what a relational database is. You
might be a developer who was, in a previous life, primarily a script developer
and wants to "get" the platform and its strong object-oriented architecture.
You might also be a more seasoned developer who just wants to get into some
of the platform-specific details of ASP.NET that make things tick under the
hood. These developers may choose to skip around a bit.
Regardless of the camp you might be in, this book is all about context. Developers
generally are very smart people; and they don't learn by memorizationthey
learn by understanding. This book takes the basics of object-oriented programming
and applies it to ASP.NET and Visual Studio to give the reader a more rounded
skillset that includes application design, test-driven development, code reuse,
modularization, and an eye on performance. The book puts Microsoft's platform
into a context that moves beyond the "how" and into the "why,"
not just explaining the concepts but selling them as the best way to solve real
problems. If you come from a scripting background or want to make your skills
more applicable to other areas of .NET programming, this book is for you.
If you are totally new to ASP.NET, this book isn't for you, yet. You should
start with one of the many ASP.NET books that have "beginner" or "introduction"
in the title. When you have the basics, come back to this book to round out
and strengthen your knowledge. We won't cover basics like master pages, user
controls, connecting to a database, configuring FormsAuthentication, and so
forth.
I want to say up front that the term "best practice" is a bit of
a misnomer. There are certainly concepts and methodologies that are better than
others, but the term implies that there are universal truths abound in the world
of programming. Some might believe that the only real universal truths are death
and taxes, so while you re ad about what I believe are best practices, keep
in mind that there's plenty of room for interpretation based on your experience
and the business problems you're trying to solve. As with anything else, use
what works and adapt it to your needs.
Play-by-Play
The following is a brief outline of what you can expect to find in the rest
of this book.
Part I: The Leap to Object Oriented Programming
Chapter 1: The Object Model
Object-oriented programming has been around for ages, but it's a new concept
for developers with a scripting background. You'll learn that everything is
an object in .NET, and your own code is part of that everything. We'll analogize
the concept of object-oriented programming to the classic example of the structure
and use of cars.
Chapter 2: Classes: The Code Behind the Objects
After you see what an object is and how it contains some kind of functionality,
we'll get into the nuts and bolts of writing a class. You'll learn about the
instantiation of objects, inheritance, protection levels, static methods,
enumerations, and interfaces.
Chapter 3: Class Design
A class can serve many different purposes in an application. Your classes
can execute a block of code, much like the familiar System.Web.UI.Page class
does, and at times they can do nothing other than group data together. More
useful classes can do all of these things.
Chapter 4: Application Architecture
Apart from ASP.NET, the n-tier approach to application development can make
even the largest projects easier to build, deploy, and maintain. We'll take
a look at this common design pattern and address when and when not to use
it.
Chapter 5: OOP Applied: The Custom Data Class
This chapter presents you with a practical example of class design that manipulates
database data and even caches it for better performance. This model shows
you the payoff of object-oriented code, where you write once and use many
times.
Part II: The ASP.NET Architecture
Chapter 6: The Nuts and Bolts of IIS and Web Applications
Regardless of how you code your application, the files, folders, and assemblies
need to be in the right places to make everything work.
Chapter 7: The ASP.NET Event Model
Every request by users of your application has a fascinating life cycle.
By understanding and following that life cycle, you can intervene or perform
certain actions at just the right time to get the most out of your application.
The execution of page, application, and control events are covered.
Chapter 8: HttpHandlers and HttpModules
ASP.NET can do so much more than produce pages, and HttpHandlers and HttpModules
are just the tools you'll need for special requests. I'll give you an example
of a handler that will protect your images from being bandwidth leeched.
Chapter 9: Server Controls
You might find that you use the same combination of controls frequently,
or that an existing control doesn't meet your needs. Building your own isn't
that hard, and it's exactly the same process used by Microsoft to create many
of the controls you already use.
Chapter 10: Web Services As Objects
It's easy to create a Web service from your existing code, and it's easy
to create a proxy class that consumes the service. What might not be as obvious
is that Web services allow you to use that remote code as if it were an object
local to your application.
Chapter 11: Membership and Security
ASP.NET has a rich set of classes to help you control access to your site
and verify who your users are. You can use little to no code or extend the
system to make your own custom solution. You'll learn how to develop a custom
Membership provider to connect the system to your own data.
Chapter 12: Personalization, Themes, and Skins
Chances are you'll want to keep more than just a user's email and password,
and again the ASP.NET team has made it possible to store this data with little
effort on your part. You can also take the leap to extend the system with
your own provider. Your users' preferences can be tied into an extensive skinning
system so they don't have to live with your site "look."
Chapter 13: Declarative Programming
With all this talk of object-oriented code, what is declarative programming
and where does it fit? We'll cover some of the common controls and their uses
available in ASP.NET.
Part III: Development Issues
Chapter 14: Developing with Visual Studio .NET
Heralded by many as the greatest development tool ever made, it's not without
its nuances and quirks. It quite possibly is the greatest tool, but you'll
have to start thinking a little like a desktop application developer. We'll
look at the approach the software takes to making your events happen and how
to debug with the best of them.
Chapter 15: Performance, Scalability, and Metrics
There are probably hundreds of things you can do to make your code industrial
strength, but there are a few basics you should know and live by. A number
of tools and techniques provide the foundation for measuring the performance
of your application.
Chapter 16: Testing, Deployment, and Code Management
The bigger a project gets, the harder it can be to maintain and deploy. There
are a number of ways to keep everything organized while testing and versioning
your code. We'll discuss the basics of test-driven development here.
Chapter 17: More Advanced Topics
The .NET Framework has more classes than you can shake a stick at. Here are
a few of the more useful ones, in a high-level overview, including streams,
networking, and threading.
Code downloads, errata and feedback
You can download the code from this book, check for errata, and give feedback
at this site:
http://www.uberasp.net/books/
Table of Contents
Preface.
I. THE LEAP TO OBJECT-ORIENTED PROGRAMMING.
1. The Object Model.
2. Classes: The Code Behind the Objects.
3. Class Design.
4. Application Architecture.
5. OOP Applied: A Custom Data Class.
II. THE ASP.NET ARCHITECTURE.
6. The Nuts and Bolts of IIS and Web Applications.
7. The ASP.NET Event Model.
8. HttpHandlers and HttpModules.
9. Server Controls.
10. Web Services As Objects.
11. Membership and Security.
12. Profiles, Themes, and Skins.
13. Declarative Programming.
III. DEVELOPMENT ISSUES.
14. Developing with Visual Studio.
15. Performance, Scalability, and Metrics.
16. Testing, Deployment, and Code Management.
17. More Advanced Topics.
About the Authors
Jeff Putz is the founder of POP World Media, LLC, a company formed
originally to organize several hobby Web sites into a bona fide business. Jeff
started programming in grade six on a TRS-80, and later moved up through an
Atari 600XL and Apple II+. After flirting with various jobs in the broadcast
world, Jeff returned to computers and welcomed the Internet in 1998, working
in various programming and management roles for several companies specializing
in vertical market content.
Jeff's POP Forums application (http://www.popforums.com) has been downloaded
tens of thousands of times and was featured in MSDN Magazine (Feb. 2004). His
company is in the process of developing several products using ASP.NET and continues
to operate CoasterBuzz (http://www.coasterbuzz.com), the world's most popular
roller coaster enthusiast site.
Customer Reviews
Customer Reviews: 1 Average Customer Rating:      Mar 11, 2005     Ray M. from Chicago, IL Now I get it... I have a friend that has been using object-oriented programming methods for years (Java and C++, mostly). When she decided to learn about ASP.NET, she was like, "This is easy!" I was still scratching my head.
Now I get it. This book pushes people like me, without a lot of formal training, into the realm of understanding OOP and more importantly how that fits into ASP.NET. I especially like the way it emphasizes everything as an application instead of one-off pages. I feel like I can be more of an architect and not just a page designer. The author doesn't talk down to the audience either. Well done.
|