as01 - Luca Cabibbo

annuncio pubblicitario
Luca Cabibbo
Architetture Software
Introduzione alle
architetture software
Dispensa AS 1
ottobre 2008
1
Introduzione alle architetture software
Luca Cabibbo – SwA
- Fonti
2
‰
[SSA] Chapter 1, Introduction
‰
[Maier&Rechtin] The Art of Systems Architecting
Introduzione alle architetture software
Luca Cabibbo – SwA
- Obiettivi e argomenti
‰
Obiettivi
ƒ motivare l’approccio e l’importanza delle architetture software
‰
Argomenti
ƒ introduzione alle architetture software
ƒ alcune definizioni
ƒ esempi
p
ƒ letture consigliate
3
Introduzione alle architetture software
Luca Cabibbo – SwA
* Introduzione alle architetture software
4
‰
I grandi sistemi software di oggi sono tra le strutture costruite dagli
uomini più complesse
ƒ contengono milioni di linee di codice, migliaia di tabelle nelle
basi di dati, e sono eseguiti da dozzine di calcolatori
ƒ la complessità di questi sistemi è via via crescente
ƒ ciò presenta ai team di sviluppo del software delle sfide
formidabili – e se queste sfide non vengono affrontate presto, i
sistemi sono consegnati in ritardo, costano più del previsto, e
con un livello di qualità inaccettabilmente povero
‰
Molti riconoscono oggi l’importanza di un approccio guidato
dall’architettura software
ƒ quali i problemi affrontati dalle architetture software?
ƒ più in generale, quali i problemi affrontati dagli approcci
architetturali?
hit tt li?
Introduzione alle architetture software
Luca Cabibbo – SwA
Funzionalità e qualità del software
‰
5
I sistemi software posseggono – oltre alle funzionalità – diverse
caratteristiche associate che ne riflettono la qualità – ad esempio
ƒ affidabilità – il software deve effettivamente fornire le
funzionalità richieste
ƒ disponibilità – il software deve essere funzionante in modo
continuato nel tempo
ƒ efficienza – il software deve fornire le prestazioni desiderate
ƒ sicurezza – il software deve fornire protezione alle sue
funzionalità ed ai suoi dati
ƒ mantenibilità – il software deve poter evolvere per soddisfare i
requisiti che cambiano dei suoi clienti
ƒ verificabilità
ifi bilità – deve
d
poter
t essere possibile
ibil verificare
ifi
lle
funzionalità e le altre qualità del software
ƒ ...
Introduzione alle architetture software
Luca Cabibbo – SwA
Ulteriori qualità del software
‰
Lo sviluppo del software, in questi ultimi anni, sta affrontando
anche delle ulteriori sfide chiave – tra cui
ƒ eterogeneità – far interagire sistemi distribuiti tra loro
eterogenei – per piattaforma, rappresentazione dei dati, ... –
consentendo un accesso ubiquitario e pervasivo
ƒ consegna e flessibilità – sviluppare tecniche per rispondere con
velocità alla consegna
g del software ed alle richieste di
cambiamento
ƒ fiducia – è essenziale potersi fidare del software
ƒ risparmio energetico
ƒ ...
ƒ agilità di business – poter creare o modificare dinamicamente
processi di business – e le applicazioni software che li
supportano
t
– in
i modo
d d
da reagire
i iin modo
d competitivo
titi nell
proprio settore di business
6
Introduzione alle architetture software
Luca Cabibbo – SwA
Che cosa sono le architetture software?
‰
7
L’architettura di un sistema software-intensive è la struttura o le
strutture del sistema, che comprendono elementi software, le
proprietà
i tà visibili
i ibili esternamente
t
t di questi
ti elementi,
l
ti e lle relazioni
l i i ttra
di essi
Introduzione alle architetture software
Luca Cabibbo – SwA
Perché sono importanti le architetture sw?
8
‰
Perché è importante l’architettura software di un sistema?
ƒ l’architettura software riconosce l’importanza di tutte le parti
interessate alle sviluppo del sistema e dei loro interessi
ƒ in particolare, tiene conto delle qualità del sistema (requisiti non
funzionali) richieste dalle varie parti interessate
ƒ prestazioni, sicurezza, verificabilità, evolvibilità, ... sono
spesso qualità cruciali per la soddisfazione del cliente
ƒ si occupa di criteri di decomposizione del sistema in elementi, e
delle relazioni tra di essi, per gestire la complessità del sistema
ƒ questa decomposizione architetturale del sistema ha una
influenza significativa sulle qualità del sistema
‰
Software architecture is the set of design decisions which, if made
incorrectly, may cause your project to be cancelled (Eoin Woods)
Introduzione alle architetture software
Luca Cabibbo – SwA
Sistemi e complessità
‰
Sistema
ƒ un insieme di elementi distinti
ƒ che sono connessi o correlati
ƒ e lavorano assieme per realizzare una combinazione
significativa
i ifi i di ffunzionalità
i
li à e qualità
li à
ƒ questa funzionalità/qualità non può essere realizzata
individualmente dai singoli elementi
‰
Complesso
ƒ composto di parti interconnesse o intrecciate
‰
Si noti come entrambe le definizioni parlano parti o elementi,
nonché di interrelazioni e interconnessioni tra le parti
9
Introduzione alle architetture software
Luca Cabibbo – SwA
Affrontare la complessità
‰
In che modo è possibile affrontare/progettare problemi/sistemi
caratterizzati da un alto livello di complessità?
ƒ partizionare (ovvero, decomporre) il sistema/problema via via in
unità più piccole e più semplici
‰
Attenzione, affinché la complessità venga ridotta, non è sufficiente
che le varie parti siano semplici
ƒ è necessario
i che
h anche
h lle iinterconnessioni
t
i i siano
i
semplici
li i
ƒ ovvero, va utilizzato un criterio di partizionamento/
decomposizione che
che, per il problema in esame
esame, sia in grado di
ridurre opportunamente la complessità delle interconnessioni
tra le parti
10
Introduzione alle architetture software
Luca Cabibbo – SwA
Ingegneria e architettura
‰
11
Ingegneria
ƒ riguarda principalmente
quantità misurabili
ƒ uso di strumenti analitici,
derivati da matematica e
fisica
ƒ processo deduttivo –
procede da postulati e
principi primi verso
d t
determinazioni
i
i i più
iù particolari
ti l i
ƒ interessata a costi
quantificabili
ƒ ambisce all’ottimizzazione
tecnica
ƒ più scienza
‰
Architettura
ƒ riguarda principalmente
qualità non misurabili
ƒ uso di strumenti e linee
guida basati su esperienze
guida,
apprese in pratica
ƒ processo induttivo – procede
dall’esperienza, per
elaborare leggi astratte e
universali
i
li
ƒ interessata al valore
qualitativo
ƒ ambisce alla soddisfazione
del cliente
ƒ più arte
Introduzione alle architetture software
Luca Cabibbo – SwA
Progettazione di sistemi complessi
‰
12
Ingegneria ed architettura rappresentano due ruoli estremi nello
spettro continuo della pratica della progettazione di sistemi
complessi
l
i
ƒ la progettazione di sistemi complessi richiede un approccio sia
ingegneristico che architetturale
ƒ in parte scienza, in parte arte
Introduzione alle architetture software
Luca Cabibbo – SwA
Progettazione di sistemi complessi
‰
13
Metodologie/approcci ingegneristico/architetturali
ƒ normativo (scienza)
ƒ basato su soluzioni pre-esistenti – “deve essere così”
ƒ razionale (scienza)
ƒ basato su principi – consente (in parte) di produrre soluzioni
“nuove” – per affrontare cambiamenti nelle necessità, nelle
preferenze o nelle circostanze
ƒ partecipativo (arte)
ƒ riconosce la complessità dovuta alla presenza di una
molteplicità di parti interessate – l’obiettivo è il consenso
ƒ euristico (arte)
ƒ basato su euristiche che codificano del “buon senso
comune” motivato da esperienza collettiva
Introduzione alle architetture software
Luca Cabibbo – SwA
Approccio delle architetture software
‰
14
Importanza dell’architettura software di un sistema
ƒ l’architettura viene definita a cavallo tra requisiti (che cosa deve
fare il sistema?) e progettazione (come è fatto il sistema?)
ƒ guida la scelta dei requisiti di qualità
ƒ guida
id lla progettazione,
i
llo sviluppo
il
e l’l’evoluzione
l i
d
dell sistema
i
ƒ riconosce l’importanza di tutte le parti interessate e dei loro
interessi – soprattutto delle qualità del sistema
ƒ prestazioni, sicurezza, verificabilità, evolvibilità, ... sono
spesso
p
q
qualità cruciali p
per la soddisfazione del cliente
ƒ si occupa della decomposizione del sistema in elementi e delle
loro inter-relazioni, per fornire al sistema le qualità richieste
ƒ sulla base di soluzioni pre-esistenti, principi ed euristiche
ƒ si occupa delle comprensione delle relazioni tra struttura
interna del sistema e sue qualità esterne
Introduzione alle architetture software
Luca Cabibbo – SwA
Riflessione: Parti interessati ed interessi
‰
I requisiti (che cosa deve fare il sistema?) di un sistema derivano
dalle varie parti interessate al sistema
ƒ utenti – chi userà il sistema
ƒ amministratori – chi gestisce il sistema
ƒ acquirente
i
– chi
hi paga per il sistema
i
ƒ sviluppatori – creano, verificano, manutengono il sistema
ƒ ...
‰
Ciascuna parte interessata ha degli interessi (funzionali e non
funzionali)
ƒ l’architettura deve tenere in considerazione e sostenere gli
interessi – spesso contrastanti – delle parti interessate
ƒ ad es., prestazioni, sicurezza e modificabilità
ƒ ll’architetto
architetto guida la definizione e la risoluzione dei requisiti più
significativi
15
Introduzione alle architetture software
Luca Cabibbo – SwA
Riflessione: Viste e punti di vista
‰
16
L’architettura software di un sistema è interessata alla
decomposizione del sistema in parti e alle relazioni tra queste parti
ƒ un singolo criterio di partizionamento/decomposizione non è di
solito sufficiente per dominare la complessità di un sistema
ƒ utile decomporre e descrivere il sistema secondo diversi
punti di vista, indipendenti ma correlati
ƒ ciascuna decomposizione costituisce un modello (una
descrizione parziale) del sistema, chiamata vista architetturale
ƒ ciascuna vista si occupa di un insieme coeso di interessi
ƒ le viste sono utili per comprendere, progettare, validare ed
attuare l’architettura – ma anche per descrivere e
comunicare l’architettura
l architettura alle varie parti interessate
ƒ la selezione e realizzazione delle viste può essere guidata da
opportuni
pp
punti di vista – ad es.,, funzionale,, delle informazioni,,
p
della concorrenza, di deployment, ...
Introduzione alle architetture software
Luca Cabibbo – SwA
Riflessione: Prospettive
‰
Un limite delle viste e dei punti di vista
ƒ alcune qualità non funzionali richiedono spesso considerazioni
attraverso più punti di vista
ƒ ad es., sicurezza, prestazioni o disponibilità
‰
Le prospettive sono una guida per la gestione delle proprietà di
qualità richieste
ƒ ciascuna prospettiva è specifica per una tipologia di requisito
non funzionale
ƒ una prospettiva viene applicata alle viste per
ƒ verificare il livello di qualità raggiunto
ƒ guidare il cambiamento delle viste – quando richiesto
17
Introduzione alle architetture software
Luca Cabibbo – SwA
Riflessione: Stili architetturali
‰
In generale, un pattern software ha lo scopo di condividere una
soluzione provata ed ampiamente applicabile ad un particolare
problema
bl
di progettazione,
tt i
descritta
d
itt iin una fforma standard
t d d che
h
possa essere facilmente riusata
ƒ un pattern architetturale (o stile architetturale) codifica
un’esperienza significativa nella realizzazione di un’architettura
software
‰
Tipicamente, uno stile architetturale
ƒ affronta un problema – un tipo di sistema, con una
combinazione di requisiti di qualità da raggiungere
ƒ propone una soluzione – in termini di tipi di elementi, relazioni
tra elementi e, in generale, criteri di decomposizione
ƒ nonché una discussione della soluzione – in termini delle varie
qualità su cui la soluzione ha impatto
18
Introduzione alle architetture software
Luca Cabibbo – SwA
Riassumendo
‰
19
La lavorazione delle architetture software può ruotare attorno a
ƒ parti interessate
ƒ chi ha interessi nel sistema – tra cui le persone per cui il
sistema viene costruito, e quelle che lo costruiscono
ƒ l’applicazione
l’
li
i
di puntii di vista
i
e viste
i
ƒ un approccio per la strutturazione dell’architettura del
sistema basato sul principio della separazione degli
sistema,
interessi, con riferimento agli interessi principali del sistema
ƒ l’applicazione
pp
di p
prospettive
p
ƒ un approccio per la (ri)strutturazione e la valutazione
dell’architettura del sistema, con riferimento ad ulteriori
i t
interessi
i principali
i i li d
dell sistema
i t
ƒ l’applicazione di stili architetturali
ƒ esperienze significative nella realizzazione di architetture
Introduzione alle architetture software
Luca Cabibbo – SwA
* Esempio – piattaforma Eclipse
http://www.eclipse.org/articles/Whitepaper-Platform-3.1/eclipse-platform-whitepaper.pdf
20
Introduzione alle architetture software
Luca Cabibbo – SwA
Piattaforma Eclipse – obiettivi
‰
‰
21
The Eclipse Platform is designed and built to meet the following requirements:
ƒ Support the construction of a variety of tools for application development.
ƒ Support
S pport an unrestricted
nrestricted set of tool pro
providers,
iders incl
including
ding independent soft
software
are
vendors (ISVs).
ƒ Support tools to manipulate arbitrary content types (e.g., HTML, Java, C, JSP,
EJB XML
EJB,
XML, and
d GIF)
GIF).
ƒ Facilitate seamless integration of tools within and across different content
types and tool providers.
ƒ Support both GUI and non-GUI-based application development environments.
ƒ Run on a wide range of operating systems, including Windows®, LinuxTM,
Mac OS X, Solaris, AIX, and HP-UX.
ƒ Capitalize on the popularity of the Java programming language for writing
tools.
The Eclipse Platform’s
Platform s principal role is to provide tool providers with mechanisms
to use, and rules to follow, that lead to seamlessly-integrated tools. These
mechanisms are exposed via well-defined API interfaces, classes, and methods.
The Platform also provides useful building blocks and frameworks that facilitate
developing new tools.
Introduzione alle architetture software
Luca Cabibbo – SwA
Piattaforma Eclipse – obiettivi
‰
‰
22
The Eclipse Platform is designed and built to meet the following requirements:
ƒ Support the construction of a variety of tools for application development.
ƒ Support
S pport an unrestricted
nrestricted set of tool pro
providers,
iders incl
including
ding independent soft
software
are
vendors (ISVs).
ƒ Support tools to manipulate arbitrary content types (e.g., HTML, Java, C, JSP,
EJB XML
EJB,
XML, and
d GIF)
GIF).
ƒ Facilitate seamless integration of tools within and across different content
si noti che si tratta principalmente
types and tool providers.
di requisiti non funzionali
ƒ Support both GUI and non-GUI-based application development environments.
ƒ Run on a wide range of operating systems, including Windows®, LinuxTM,
Mac OS X, Solaris, AIX, and HP-UX.
ƒ Capitalize on the popularity of the Java programming language for writing
tools.
The Eclipse Platform’s
Platform s principal role is to provide tool providers with mechanisms
to use, and rules to follow, that lead to seamlessly-integrated tools. These
mechanisms are exposed via well-defined API interfaces, classes, and methods.
The Platform also provides useful building blocks and frameworks that facilitate
developing new tools.
Introduzione alle architetture software
Luca Cabibbo – SwA
Piattaforma Eclipse – architettura a plug-in
‰
‰
‰
‰
‰
‰
23
A plug-in is the smallest unit of Eclipse Platform function that can be developed
and delivered separately. Usually a small tool is written as a single plug-in,
whereas a complex tool has its functionality split across several plug-ins.
plug ins. Except
for a small kernel known as the Platform Runtime, all of the Eclipse Platform's
functionality is located in plug-ins.
Plug-ins
Plug
ins are coded in Java
Java. A typical plug-in
plug in consists of Java code in a Java
Archive (JAR) library, some read-only files, and other resources such as images,
web templates, message catalogs, native code libraries, etc. ...
Each plug-in has a plug-in manifest declaring its interconnections to other plugins. The interconnection model is simple: ...
On start-up, the Platform Runtime discovers the set of available plug-ins, reads
their manifests,
manifests and builds an in
in-memory
memory plug-in
plug in registry
registry. ...
A plug-in is activated when its code actually needs to be run. Once activated, ...
By determining the set of available plug-ins up front, and by supporting a
significant
i ifi
t exchange
h
off iinformation
f
ti b
between
t
plug-ins
l i without
ith t h
having
i tto activate
ti t
any of them, the Platform can provide each plug-in with a rich source of pertinent
information about the context in which it is operating. ...
Introduzione alle architetture software
Luca Cabibbo – SwA
Piattaforma Eclipse – architettura a plug-in
‰
‰
‰
‰
‰
‰
24
A plug-in is the smallest unit of Eclipse Platform function that can be developed
and delivered separately. Usually a small tool is written as a single plug-in,
whereas a complex tool has its functionality split across several plug-ins.
plug ins. Except
for a small kernel
known as
the Platform Runtime,
the Eclipse Platform's
definisce
un’architettura
in cui all
ci of
sono
functionality is located in plug-ins.
dei componenti chiamati plug-in
Plug-ins
Plug
ins are coded in Java
Java. A typical plug-in
plug in consists of Java code in a Java
Archive (JAR) library, some read-only files, and other resources such as images,
descrive
modalità
di comunicazione
web templates,
messagelecatalogs,
native
code libraries, etc. ...
tra
ciascun
plug-in
p
g
ed its
il resto
Each plug-in has a plug-in manifest declaring
interconnections to other plugins. The interconnection model
is simple: ...
dell’architettura
On start-up, the Platform Runtime discovers the set of available plug-ins, reads
their manifests,
manifests and
builds an
in-memory
memory plug-in
plug in registry
registry.
descrive
il in
raggiungimento
degli ...
A plug-in is activated
when its
actually
be run. Once activated, ...
obiettivi
di code
qualità
sullaneeds
baseto di
By determining the set of
available
quest’organizzazione
q
g plug-ins up front, and by supporting a
significant
i ifi
t exchange
h
off iinformation
f
ti b
between
t
plug-ins
l i without
ith t h
having
i tto activate
ti t
any of them, the Platform can provide each plug-in with a rich source of pertinent
information about the context in which it is operating. ...
Introduzione alle architetture software
Luca Cabibbo – SwA
- Esempio – Java Enterprise Edition
‰
25
Da Java EE Tutorial
ƒ Developers today increasingly recognize the need for
distributed, transactional, and portable applications that
leverage the speed, security, and reliability of server-side
technology In the world of information technology
technology.
technology, enterprise
applications must be designed, built, and produced for less
money, with greater speed, and with fewer resources.
ƒ With the JavaTM Platform, Enterprise Edition (Java EE),
development of Java enterprise applications has never been
easier or faster
faster. The aim of the Java EE 5 platform is to provide
developers a powerful set of APIs while reducing development
time, reducing application complexity, and improving application
performance.
Introduzione alle architetture software
Luca Cabibbo – SwA
Esempio – Java Enterprise Edition
‰
26
Da Java EE Tutorial
ƒ Developers today increasingly recognize the need for
distributed, transactional, and portable applications that
leverage the speed, security, and reliability of server-side
technology In the world of information technology
technology.
technology, enterprise
applications must be designed, built, and produced for less
notare l’enfasi su requisiti non
money, with greater speed, and with fewer resources.
funzionali di qualità
funzionali,
ƒ With the JavaTM Platform, Enterprise Edition (Java EE),
development of Java enterprise applications has never been
easier or faster
faster. The aim of the Java EE 5 platform is to provide
developers a powerful set of APIs while reducing development
time, reducing application complexity, and improving application
performance.
Introduzione alle architetture software
Luca Cabibbo – SwA
Architettura delle API di Java EE
http://java.sun.com/javaee/
27
Introduzione alle architetture software
Luca Cabibbo – SwA
Modello applicativo per Java EE
28
Introduzione alle architetture software
Luca Cabibbo – SwA
Modello applicativo per Java EE
descrive l’architettura delle applicazioni
che possono eseguite in un application
server Java EE
come effettuare la decomposizione
p
architetturale di un’applicazione se la
tecnologia target è Java EE?
quali qualità possiedono le applicazioni
per la p
p
piattaforma Java EE?
come sono assicurate queste qualità?
29
Luca Cabibbo – SwA
Introduzione alle architetture software
- Architetture a strati
‰
Molte architetture sono basate su un’organizzazione a strati
(Layers)
quali vantaggi ci sono ad adottare
un’architettura
’ hit tt
a strati?
t ti?
quali svantaggi?
perché?
p
Distribution
Business (service)
Domain
Architettura standard
(ANSI/SPARC)
Order Management
Inventory
a tre livelli per DBMS
GUI windows
Purchasing
reports
speech interface
HTML, XML, XSLT, JSP, Javascript, ...
UI
(AKA Presentation, View)
handles presentation layer requests
workflowBusiness processes
session state
window/page transitions
consolidation/transformation of disparate
data for presentation
Application
(AKA Workflow, Process,
Mediation, App Controller)
come decomporre (ulteriormente)
gli strati di un’architettura la cui
g
organizzazione fondamentale è a
strati?
utente
utente
more
app
specific
utente
handles application layer requests
implementation of domain rules
domain services (POS, Inventory)
Business services
- services may be used by just one
application,
pp
but there is also the p
possibility
y
of multi-application services
Schema
esterno
very general low-level business services
used in many business domains
CurrencyConverter
Schema
esterno
Domain
(AKA Business,
Application Logic, Model)
utente
utente
Schema
esterno
Schema logico
Business Infrastructure
(AKA Low-level Business Services)
Infrastructure services
(relatively) high-level technical services
and frameworks
Persistence, Security
Technical Services
(AKA Technical
Infrastructure,
Schema
interno
High-level Technical Services)
Component-based service realizations
low-level technical services, utilities,
and frameworks
data structures, threads, math,
file, DB, and network I/O
CRM
operational systems
30
Introduzione alle architetture software
Foundation
(AKA Core Services, Base Services,
Low-level Technical Services/Infrastructure)
BD
ERP
width implies range of applicability
Databases
Packaged
applications
Legacy
applications
Luca Cabibbo – SwA
- Esempio – architettura di Google
http://infolab.stanford.edu/~backrub/google.html
31
Introduzione alle architetture software
Luca Cabibbo – SwA
Esempio – architettura di Google
‰
‰
‰
32
In Google, the web crawling (downloading of web pages) is done by several distributed crawlers. There is
a URLserver that sends lists of URLs to be fetched to the crawlers. The web pages that are fetched are
then sent to the storeserver. The storeserver then compresses and stores the web pages into a
repository Every web page has an associated ID number called a docID which is assigned whenever a
repository.
new URL is parsed out of a web page. The indexing function is performed by the indexer and the sorter.
The indexer performs a number of functions. It reads the repository, uncompresses the documents, and
parses them. Each document is converted into a set of word occurrences called hits. The hits record the
word position in document
word,
document, an approximation of font size,
size and capitalization
capitalization. The indexer distributes
these hits into a set of "barrels", creating a partially sorted forward index. The indexer performs another
important function. It parses out all the links in every web page and stores important information about
them in an anchors file. This file contains enough information to determine where each link points from
and to
to, and the text of the link
link.
The URLresolver reads the anchors file and converts relative URLs into absolute URLs and in turn into
docIDs. It puts the anchor text into the forward index, associated with the docID that the anchor points to.
It also generates a database of links which are pairs of docIDs. The links database is used to compute
PageRanks for all the documents
documents.
The sorter takes the barrels, which are sorted by docID (this is a simplification, see Section 4.2.5), and
resorts them by wordID to generate the inverted index. This is done in place so that little temporary space
is needed for this operation. The sorter also produces a list of wordIDs and offsets into the inverted index.
A program called
ll d D
DumpLexicon
L i
ttakes
k thi
this lilistt ttogether
th with
ith th
the llexicon
i
produced
d
db
by th
the iindexer
d
and
d
generates a new lexicon to be used by the searcher. The searcher is run by a web server and uses the
lexicon built by DumpLexicon together with the inverted index and the PageRanks to answer queries.
Introduzione alle architetture software
Luca Cabibbo – SwA
Esempio – architettura di Google
‰
‰
‰
In Google, the web crawling (downloading of web pages) is done by several distributed crawlers. There is
a URLserver that sends lists of URLs to be fetched to the crawlers. The web pages that are fetched are
then sent to the storeserver. The storeserver then compresses and stores the web pages into a
una
checalled
descrive
la is assigned whenever a
repository Everyèweb
repository.
pagevista
has anfunzionale,
associated ID number
a docID which
new URL is parsed
out of a web page. Thedi
indexing
function
performed by
decomposizione
Google
inistermini
di the indexer and the sorter.
The indexer performs a number of functions. It reads the repository, uncompresses the documents, and
elementi
funzionali,
parses them. Each document
is converted
into a setrelativamente
of word occurrences called hits. The hits record the
word position in document
word,
document, an approximation of font size,
size and capitalization
The indexer distributes
all’implementazione
ll’i l
t i
d
dell’algoritmo
ll’ l capitalization.
it
these hits into a set of "barrels", creating a partially sorted forward index. The indexer performs another
important function. It parses out all thePageRank
links in every web page and stores important information about
them in an anchors file. This file contains enough information to determine where each link points from
and to
to, and the text of the link
link.
The URLresolver reads
the anchors file and converts
relative URLs into absolute URLs and in turn into
è sostanzialmente
un’architettura
docIDs. It puts the anchor text into the forward index, associated with the docID that the anchor points to.
pipes&filters
It also generates a database of links which are pairs of docIDs. The links database is used to compute
PageRanks for all the documents
documents.
The sorter takes the barrels, which are sorted by docID (this is a simplification, see Section 4.2.5), and
resorts them by wordID to generate the inverted index. This is done in place so that little temporary space
is needed for this operation. The sorter also produces a list of wordIDs and offsets into the inverted index.
maL come
Google
soddisfare
i d d bby th
A program called
ll d D
DumpLexicon
i
ttakes
k fathi
this
lilistt ttogether
tha with
ith th
the llexicon
i
produced
the iindexer
d
and
d
generates a new lexicon to be used by the searcher. The searcher is run by a web server and uses the
requisiti relativi a prestazioni e
lexicon built by DumpLexicon together with the inverted index and the PageRanks to answer queries.
scalabilità?
33
Introduzione alle architetture software
Luca Cabibbo – SwA
- Esempio – Google Chrome
‰
Google Chrome è un browser progettato per rendere più veloce,
facile e sicuro l'uso del Web con un design minimo che non
i t l i lla navigazione
intralcia
i
i
[htt
[http://www.google.com/chrome]
//
l
/ h
]
il fumetto di presentazione di Google
Chrome descrive alcuni requisiti di
qualità chiave affrontati dal progetto,
nonché alcune scelte architetturali
significative
34
Introduzione alle architetture software
Luca Cabibbo – SwA
* Letture consigliate
35
Introduzione alle architetture software
Luca Cabibbo – SwA
Letture consigliate
36
Introduzione alle architetture software
Luca Cabibbo – SwA
Letture consigliate
37
Introduzione alle architetture software
Luca Cabibbo – SwA
Letture consigliate
38
Introduzione alle architetture software
Luca Cabibbo – SwA
Scarica