0
I Use This!
Activity Not Available
Analyzed about 6 years ago. based on code collected almost 8 years ago.

Project Summary

Flyweights are small handle classes for immutable data that intelligently share their content to prevent memory duplication. The Flyweight class has been designed as simply as possible and can be used as a drop-in replacement for T.

ProblemImagine an application that has hundreds or thousands of users. Each user has a first and last name, stored as separate strings in memory. It is highly likely that some of them share the same first or last names; if there are 20 people with the first name "Richard" then 20 duplicate instances of "Richard" will exist in memory.

SolutionThe best way to demonstrate how Flyweights can address this problem is with a very simple example:

Flyweight a = "Richard";
Flyweight b = "Richard";
Flyweight c = "Richard";
Flyweight d = "Richard";
Flyweight e = "Richard";With regular System.String objects, five separate copies of "Richard" would exist concurrently, even though they are all identical. Flyweights can detect this, and will only store one object in memory.

DocumentationFlyweight details and examples UnsafeFlyweight details and examples Design and rationale Extending the library Acknowledgements DownloadThe Flyweights source is currently available in SVN, or via the downloads page.

Requirements.NET framework 2.0 or higher.

Tags

csharp csharpdotnet designpattern dotnet flyweight flyweights library memory visualcsharp visualcsharpdotnet

In a Nutshell, flyweights...

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    learn about Open Hub updates and features on the Open Hub blog
  • ...
    nearly 1 in 3 companies have no process for identifying, tracking, or remediating known open source vulnerabilities
  • ...
    anyone with an Open Hub account can update a project's tags

Languages

Languages?height=75&width=75
C#
92%
XML
8%

30 Day Summary

not available

12 Month Summary

not available

Ratings

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!