Design Patterns : Elements of Reusable Object-Oriented Software



Download 4,06 Mb.
Pdf ko'rish
bet40/288
Sana07.04.2022
Hajmi4,06 Mb.
#535140
1   ...   36   37   38   39   40   41   42   43   ...   288
Bog'liq
GOF Design Patterns

Document Structure 
A document is ultimately just an arrangement of basic graphicalelements such as 
characters, lines, polygons, and other shapes. Theseelements capture the total 
information content of the document. Yet anauthor often views these elements not 
in graphical terms but in termsof the document's physical structure

lines, columns, 


Design Patterns: Elements of Reusable Object-Oriented Software 
48 
figures,tables, and other substructures.
2
In turn, these substructures have 
substructures of theirown, and so on. 
Lexi's user interface should let users manipulate thesesubstructures directly. 
For example, a user should be able to treat adiagram as a unit rather than as 
a collection of individual graphicalprimitives. The user should be able to refer 
to a table as a whole,not as an unstructured mass of text and graphics. That helps 
make theinterface simple and intuitive. To give Lexi's implementationsimilar 
qualities, we'll choose an internal representation thatmatches the document's 
physical structure. 
In particular, the internal representation should support thefollowing: 

Maintaining the document's physical structure, that is, thearrangement of 
text and graphics into lines, columns, tables, etc. 

Generating and presenting the document visually. 

Mapping positions on the display to elements in the internalrepresentation. 
This lets Lexi determine what the user isreferring to when he points to 
something in the visual representation. 
In addition to these goals are some constraints. First, we shouldtreat text and 
graphics uniformly. The application's interface letsthe user embed text within 
graphics freely and vice versa. We shouldavoid treating graphics as a special 
case of text or text as a specialcase of graphics; otherwise we'll end up with 
redundant formatting andmanipulation mechanisms. One set of mechanisms should 
suffice forboth text and graphics. 
Second, our implementation shouldn't have to distinguish betweensingle elements 
and groups of elements in the internal representation.Lexi should be able to treat 
simple and complex elementsuniformly, thereby allowing arbitrarily complex 
documents. The tenthelement in line five of column two, for instance, could be 
a singlecharacter or an intricate diagram with many subelements. As long as weknow 
this element can draw itself and specify its dimensions, itscomplexity has no 
bearing on how and where it should appear on thepage. 
Opposing the second constraint, however, is the need to analyze thetext for such 
things as spelling errors and potential hyphenationpoints. Often we don't care 
whether the element of a line is a simpleor complex object. But sometimes an analysis 
depends on the objectsbeing analyzed. It makes little sense, for example, to check 
thespelling of a polygon or to hyphenate it. The internalrepresentation's design 
should take this and other potentiallyconflicting constraints into account. 



Download 4,06 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   288




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish