Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: Flyweight vs Value Object

BOWMAN, James

2003-08-21


That is not the flyweight pattern. A flyweight is an object that you only
use one instance. It is similar to a singleton, but the clients are not
necessarily aware that they are all sharing the same instance and hence the
method in which it is instantiated is different.

-----Original Message-----
From: Sanjiv Kapila [mailto:skapila@(protected)]
Sent: 21 August 2001 07:22
To: J2EEPATTERNS-INTEREST@(protected)
Subject: [J2EEPAT-INT] Flyweight vs Value Object


Can any one highlight me pros & cons of Flyweight vs Value Object paatern.
As per my understanding Flyweight calls for dividing the result or their
transfer across n/w in smaller bunched to avoid overloading whereas value
object clubs diff. request in one to save multiple calls over network.

Also I would like to know code snippet for making a flyweight pattern i.e.
segregating a resulset in multiple bunches. I know we have fetchSize() that
can define the no of records to fetch but how to indicate that pointer for
starting record. Also what will happen if during this fetching some new
records are inserted in the requested table?

Regards
Sanjiv

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to
listserv@(protected)

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003

====================================================================
Companion Site: http://www.corej2eepatterns.com
J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns
List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.