09.01.2013 Views

CISC 323 Intro to Software Engineering

CISC 323 Intro to Software Engineering

CISC 323 Intro to Software Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

¤<br />

¢ £<br />

¤ ¥<br />

¦ §<br />

¨¥<br />

©�<br />

Flyweight Implementation<br />

create (intrinsicData)<br />

• Client creates flyweight instances using flyweightFac<strong>to</strong>ry<br />

• Fac<strong>to</strong>ry requires intrinsic data as parameter -- e.g., parameter is<br />

“a” <strong>to</strong> create instance of character “a”<br />

• Fac<strong>to</strong>ry returns flyweight object with this intrinsic data<br />

• Client must maintain extrinsic data -- e.g., character font, position<br />

¤�<br />

§<br />

©��<br />

�<br />

�<br />

��<br />

��<br />

�<br />

�<br />

��<br />

��<br />

�<br />

�<br />

� � ����<br />

�£<br />

� § �<br />

¤<br />

¤ ¥<br />

§£ �<br />

�<br />

���<br />

��<br />

©§<br />

� �<br />

��<br />

¡

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

Saved successfully!

Ooh no, something went wrong!