Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Windows Presentation Foundation

You're reading from   Mastering Windows Presentation Foundation Master the art of building modern desktop applications on Windows

Arrow left icon
Product type Paperback
Published in Feb 2017
Publisher Packt
ISBN-13 9781785883002
Length 568 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Sheridan Yuen Sheridan Yuen
Author Profile Icon Sheridan Yuen
Sheridan Yuen
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. A Smarter Way of Working with WPF 2. Debugging WPF Applications FREE CHAPTER 3. Writing Custom Application Frameworks 4. Becoming Proficient with Data Binding 5. Using the Right Controls for the Job 6. Mastering Practical Animations 7. Creating Visually Appealing User Interfaces 8. Implementing Responsive Data Validation 9. Completing That Great User Experience 10. Improving Application Performance 11. Deploying Your Masterpiece Application 12. What Next?

Shrinking data objects

Quite often, our applications will have fairly sizable data objects, with dozens, or even hundreds of properties. If we were to load all of the properties for each data object when we have thousands of them, our application would slow down and possibly even run out of memory.

We might think that we can save on RAM by simply not populating all of the property values, but if we use the same classes, we'll soon find that even the default or empty values for these properties may consume too much memory. In general and with a few exceptions, unset properties take the same amount of RAM as set properties.

If our data model object has a very large number of properties, one solution would be to break it down into much smaller pieces. For example, we could create a number of smaller, sub product classes, such as ProductTechnicalSpecification, ProductDescription, ProductDimension, ProductPricing, etc.

Rather than building one giant View to edit the whole product, we could...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime