471,348 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

example for flyweight pattern

hey all,

imagine the following:

a screen full of circles. each circle has coordinates and a style. the
coordinates are always different, a style can be the same among 0 to
many circles.

what would be the correct implementateion of the flyweight pattern?

a) one (circle-)object for every different style, and the coordinates
for all circles stored in the context.
b) one circle-object for every different set of coordinates and the
styles stored in the context.

and in general: how would you solve this issue most memory efficient,
if not by one of the two answers above (imagine billions of circles
and tenthousands of styles)?

Jun 27 '08 #1
0 1205

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by gsv2com | last post: by
1 post views Thread by Hung Jung Lu | last post: by
10 posts views Thread by Daniel Ortmann | last post: by
1 post views Thread by marek | last post: by
1 post views Thread by ash | last post: by
34 posts views Thread by Steven Nagy | last post: by
11 posts views Thread by td0g03 | last post: by
4 posts views Thread by Aaron Gray | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.