15.01.2013 Views

Foundations of Programming - Karl Seguin

Foundations of Programming - Karl Seguin

Foundations of Programming - Karl Seguin

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9 - Back to Basics: Proxy This and Proxy That<br />

In This Chapter<br />

In chapter 6 we briefly covered NHibernate's lazy loading capabilities. In this chapter we expanded on<br />

that discussion by looking more deeply at the actual implementation. The use <strong>of</strong> proxies is common<br />

enough that you'll not only frequently run into them, but will also likely have good reason to implement<br />

some yourself. I still find myself impressed at the rich functionality provided by RhinoMock and<br />

NHibernate thanks to the proxy design pattern. Of course, everything hinges on you allowing them to<br />

override or insert their behavior over your classes. Hopefully this chapter will also make you think about<br />

which <strong>of</strong> your methods should and which shouldn't be virtual. I strongly recommend that you follow the<br />

links provided on the first page <strong>of</strong> this chapter to understand the pros and cons <strong>of</strong> virtual and final<br />

methods.<br />

<strong>Foundations</strong> <strong>of</strong> <strong>Programming</strong> Copyright © <strong>Karl</strong> <strong>Seguin</strong> www.codebetter.com<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!