Under the Hood of .NET Memory Management - Simple Talk
Under the Hood of .NET Memory Management - Simple Talk
Under the Hood of .NET Memory Management - Simple Talk
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 5: Application-Specific Problems<br />
WPF also sets <strong>the</strong> l<strong>of</strong>ty goal <strong>of</strong> minimizing <strong>the</strong> likelihood <strong>of</strong> data binding creating<br />
memory leaks. Among o<strong>the</strong>r things, WPF wants to make it simple and straightforward to<br />
bind data to <strong>the</strong> UI.<br />
control.ItemsSource = collection;<br />
Listing 5.25: <strong>Simple</strong> data binding.<br />
If <strong>the</strong> control in question is an ItemControl and <strong>the</strong> collection implements<br />
INotifyCollectionChanged, <strong>the</strong>n <strong>the</strong> item control will automatically wire up<br />
to <strong>the</strong> collection's CollectionChanged event. This is both powerful and dangerous, as<br />
"easy" does not always also mean "sensible."<br />
For all that WPF takes a lot <strong>of</strong> complexity away from tired eyes, I hope you can see why<br />
it's worth being aware that that complexity still exists, and still needs to be factored into<br />
your code.<br />
Windows Communication Framework<br />
Windows Communication Framework (WCF) is Micros<strong>of</strong>t's solution for distributed<br />
computing and Service-Oriented Applications (SOA). With WCF you can spread <strong>the</strong><br />
processing load over one or more servers, allowing you to put <strong>the</strong> presentation logic on<br />
one server and <strong>the</strong> data access / business logic on ano<strong>the</strong>r. There are a couple <strong>of</strong> issues<br />
inherent in such a separation, but <strong>the</strong>re are also some compelling reasons to follow this<br />
type <strong>of</strong> deployment model.<br />
170