Ovido
Lingua
  • Inglese
  • Spagnolo
  • Francese
  • Portoghese
  • Tedesco
  • Italiano
  • Olandese
  • Svedese
Testo
  • Maiuscole

Utente

  • Accedi
  • Crea account
  • Passa a Premium
Ovido
  • Home
  • Accedi
  • Crea account

Flyweight

Qual è l'intento del pattern Flyweight?

Utilizzare la condivisione per supportare un numero elevato di oggetti fini in modo efficiente, riducendo i costi di memoria e runtime.

Perché usare il pattern Flyweight?

Le strutture di oggetti complesse possono semplificare il design ma essere troppo costose in termini di memoria.
Un esempio è un editor di documenti che necessita di centinaia di migliaia di oggetti carattere, consumando memoria e creando overhead di runtime.

Flyweight consente di condividere oggetti per ridurre il numero totale di istanze.

Quando è opportuno usare il pattern Flyweight?

Quando un'applicazione utilizza un numero elevato di oggetti.
Quando i costi di archiviazione sono elevati a causa del numero di oggetti.

Quando gran parte dello stato dell'oggetto può essere resa estrinseca.

Quando molti oggetti possono essere sostituiti da un numero ridotto di oggetti condivisi.

Quando l'applicazione non dipende dall'identità dell'oggetto.

Quali sono i partecipanti nel pattern Flyweight?

Flyweight: Definisce un'interfaccia per ricevere e agire sullo stato estrinseco.
ConcreteFlyweight (es. Carattere): Implementa lo stato intrinseco condiviso; è indipendente dal contesto.

UnsharedConcreteFlyweight (es. Riga, Colonna): Alcuni oggetti non devono essere condivisi.

FlyweightFactory: Crea e gestisce oggetti Flyweight, assicurandosi che siano condivisi.

Client: Memorizza e passa lo stato estrinseco ai Flyweight.

Come collaborano i componenti nel pattern Flyweight?

Lo stato intrinseco è memorizzato in ConcreteFlyweight, mentre lo stato estrinseco è gestito dai client.
I client passano lo stato estrinseco al Flyweight al momento dell'uso.

I client ottengono i Flyweight esclusivamente tramite FlyweightFactory, che garantisce la condivisione.

Quali sono i vantaggi e gli svantaggi del pattern Flyweight?

Vantaggi:

Riduce il consumo di memoria condividendo gli oggetti.

Aumenta l'efficienza man mano che più Flyweight sono condivisi.

Riduce il numero di istanze necessarie per rappresentare grandi strutture di oggetti.

Svantaggi:


Può introdurre costi di runtime per calcolare o passare lo stato estrinseco.

La gestione della condivisione può aggiungere complessità.

Quali sono gli aspetti principali dell'implementazione del pattern Flyweight?

Rimuovere lo stato estrinseco: Identificare e separare lo stato dipendente dal contesto, rendendolo esterno agli oggetti condivisi.
Gestire gli oggetti condivisi: Usare una FlyweightFactory per creare e recuperare oggetti Flyweight, evitando che i client li istanzino direttamente.

Condivisione permanente: Per oggetti con un numero fisso, mantenerli in memoria permanentemente, ad esempio i caratteri ASCII.

Dove viene utilizzato il pattern Flyweight?

In applicazioni che necessitano di rappresentare grandi strutture di oggetti, come editor di testo o grafica vettoriale.

Quali pattern sono correlati al Flyweight?

Composite: Per rappresentare strutture gerarchiche condivise.
State e Strategy: Per condividere strategie o stati comuni tra oggetti.

Quiz
trachemys scrypta
Facade
Decorator
Composite
Bridge
Adapter
tortue d hermann
MAD chapter 9 part 2
REGION 9: ZAMBOANGA PENINSULA
Latijn woorden module 2
Atomu branduolių virsmai
geografia
Futuro simple
Sanat
Ruotsi kappale 3 sanat eri muodot lyhyet
prep con dat
psykiatri 2
fqreacciones quimicas
Biologi 7.5 Hörsel och balans
admin
Activism in sport
citatiô chap 9 et 10
italianske glosor 1
CHAPTER 5: Memory: Models and Research Methods
riri
causes of th WW1
anglais
RH Pratiques
vocabulary 1
music and arts
Músculos de miembro sup
quimica segundo periodo
Literary Elements
literay elements
Week 11 - Chapter 10 and 11: Muscles
Week 13 - Chapter 19: Blood
Révison finale: sport
piano notespiano notes
Vold (powerpoint)
historia
Massage Course
polish language
VWL
russian study
systeme immunitaire
no fysik
origini di romadomande
food 什么
2 décembre
franska glosorhej
vocabulaire série TVvocabulaire TV shows
meds 💊
segundo teste
Economic Methodology and the Economic Problem
atomer mm
chapitre 1
IMPORTANT QUOTES
Still
citations caractere
fransleerstof van 4 toerisme frans hoofdstuk 1 vocabulaire.
1,4
VSEPR (BUT1)
1,3.
9.2: Kantoor en kantoorartikelen
Diritto Romano
fysik
latina
Problemas de filosofia politica
der / die / das
enflish techniques
1,2.
1,1.
duits grammatica der die das
tres generaciones de derechos
PoK
Articulos 1, 2, 3, 4 y 5 de la declaracion de los derechos humanos
voc 10 (Education in crisis)
chapitre 3 (relation to the world) synonyme / antonyme
9.1: Gereedschap
religion
De viaje
chapitre 3 (relation to the world)
20.2: Vormen
Laurence Sterne
bio
en la ciudad
20.1: Kleuren
Ord
mi casa
ComptabilitéPartie 1
Filosofía
Kappale 2
finance
spanska glosor
Biologi 7.3 Lukt, smak, känsel & 7.4 Synen
8.3: Universiteit, studie
8.2: Onderwijs, school
8.1: Opvoeding, vorming
Ambroise Pare
Ambroise Pare
Andreas vesalius
john hunter
joseph lister
edward jenner
william harvey
Italienska oregelbundna verb
louis pasteur
robert koch
Französisch Vokabel Unité 15
unidad 7
Ruotsi kappale 3 En, Ett sanat eri muodot
English NRI quiz 4
Digestive system
bio 208 lab final
vocabulario A2
writing and speaking sample
Orientierung in der shule
Kemiprov begrepp 6/12
Portfolio
markets law and regulations
andravärldskriget
helsepsykologi
gas exchange (emily)
engelska
Primera Guerra Mundial
idioma
trad
tard
MAD chapter 9 part 1
trad
CS Network and Security threats
basic french physical description
...
divisione cellularela divisione cellulare nei procarioti e negli eucarioti, la mitosi, la rproduzione sessuata e la meiosi, il cariotipo e gli errori nella meiosi
Franskaprov 1
Victimology
MAD chapter 8 part 5
MAD chapter 8 part 4
italienisch vokabel
some major blood vessels in the body
MAD chapter 8 part 3
MAD chapter 8 part 2
MAD chapter 8 part 1
MAD 7 part 2
opportunities challenge reading comprehension determining textual evidence and fchoice the best answer
Freedom, Intersubjectivity, Society,DiesChoice the best answer
philosophy
MAD 7 part 1
MAD 6 part 1
Biologi 7.1 Nervceller mm
PSP, Morphine et Pharmacodépendanceauto-evaluation
spijsvertering
Geo
DPF
ANAT action et trajet
kemi
Ruotsi kappale 3 Verbit eri muodot
FRANCÉS T. 2.
ANAT action+ trajet
japanese vocab
c# chapter 8 part 2
Magia, stregoneria.
c# chapter 8 part 1
c# chapter 7 part 2
c# chapter 7 part 1
c# chapter 5 part 3
respiratory system
c# chapter 5 part 2
c# chapter 5 part 1
c# chapter 6 part 2
c# chapter 6 part 1
java chapter 14 part 3
java chapter 14 part 2
angie
java chapter 14 part 1
java chapter 13 part 2
java chapter 13 part 1
java chapter 12 part 2
java chapter 12 part 1
java 2 chapter 11 part 2
java 2 chapter 11 part 1
21st Reviewer
ANAT actions + trajet
UE4
UE4
UE4innvervations
Tyska glosor
Elektromagnatism begrepp
prov kapitel 1!
Aviculturafisiologia da digestão
pompeo e crasso
interrogativos
concetti fondamentali del codice civile
Diritto privato
christmas memory verse.
PSP, Les Anxiolytiquesauto-correction
surfer girl
Kemins grunder
PR2 REVIEWER
ue3milieu interne
Clara
Duits Schritt 50
UCSP REVIEWER
Ausiàs March
russo 1
Verbi
statistica
EspagnolVocabulaire
german 32
IWBRS
GW
Lengua temas 3 y 13
respiratory system
Ordi Pedia
Guess That Quote!
IPHP REVIEWER
salud 2 periosod2
so1. Berätta om jakten på kolonier och hur det var en orsak till första världskriget På 1800-talet skaffade Frankrike och Storbritannien många kolonier. Kolonierna gav dem status, makt, pengar och råvar...
brunelleschi
CFRR
thermoregulation (emily)
Chemistry
Le potenze e le leve
Český jazyk - moderna🦾🫀🧠
chem Acid def day quiz
RadiationFlashcards.
spanisch
so prov
History
knochen
Tema 3
histoire chap 1 et 2
latin chap.8 vocab
Lateinnnn
DNS-
Ed civica onu
Week 12 - Chapter 18: The Endocrine System
Lukt, smak och känselbiologiprov
historiadescripciones
Film horror
glosor v.48
Geography
Examen Tecnicas Almacen
sivert
Surf
l'universo e le stelle e le galassie
GCP certifs
glosor v. 48
kap 11 del 2
v.48
29nov2024
la metropolisation en France
2q SCI
stoffen in huisnask
inactve fault
inglese tecnico
anatomi
Mapeh (Music) 2nd examstudy!
anglais cc1
SO ekonomi åk 8 6. Frågor presentationen
23)English Vocabulary in Use
drivers test missed questions
Ions polyatomiques
teoria della comunicazione
Derecho del Trabajo Parte Sustantiva Segundo Parcial - copiarepaso para un examen
Hassandensity and boyency and mix and flow grade 8
ioni poliatomici
placas tectonica
foods
schopenhauer
sartre
aristòtil
italiano
spanish stem-changing verbs
nomi in greco-26
samhällskunskap
shopenhauer
sartre
aristoteles
platón
socrates
ak hoofdstuk 2
englischKlassenarbeit Vocabeltest