%%Page: 1 1 1 0 bop 8519 12841 a Fs(Demeter:)778 b(A)577 b(CASE)h(Study)h(of)f (Soft)-50 b(w)g(are)580 b(Gro)-50 b(wth)13946 15276 y(Through)579 b(P)-50 b(arameterized)580 b(Classes)16477 18486 y Fr(Karl)435 b(J.)f(Lieb)36 b(erherr,)432 b(Arth)-36 b(ur)433 b(J.)h(Riel)10743 20036 y(Northeastern)f(Univ)-36 b(ersit)g(y)-108 b(,)434 b(College)i(of)e(Computer)f(Science)13791 21586 y(360)i(Hun)-36 b(tington)432 b(Av)-36 b(en)g(ue,)434 b(Boston)f(MA)h(02115)20695 24191 y(Decem)-36 b(b)36 b(er)433 b(14,)i(2004)17844 28287 y Fq(Cop)-31 b(yrigh)g(t)23351 28254 y(c)23043 28287 y Fp(\015)p Fq(1988)371 b(Karl)f(Lieb)31 b(erherr)23814 30611 y Fo(Abstract)11277 32346 y Fn(The)331 b Fm(D)28 b(emeter)17434 31923 y Fl(T)108 b(M)19257 32346 y Fn(system)332 b(is)f(a)f(CASE)g(\(Computer-Aided)h(Soft)-28 b(w)g(are)329 b(Engi-)9741 33564 y(neering\))265 b(to)28 b(ol)265 b(designed)f(for)f (the)i(dev)-28 b(elopmen)g(t)265 b(of)f(large)g(soft)-28 b(w)g(are)262 b(pro)57 b(jects)264 b(using)9741 34782 y(a)307 b(new)g(soft)-28 b(w)g(are)305 b(design)j(metho)28 b(dology)308 b(whic)-28 b(h)307 b(fo)28 b(cuses)307 b(on)g(gro)-28 b(wing)305 b(rather)i(than)9741 35999 y(building)382 b(soft)-28 b(w)g(are.)574 b(W)-85 b(e)382 b(describ)28 b(e)382 b(the)g(soft)-28 b(w)g(are)379 b(dev)-28 b(elopmen)g(t)383 b(pro)28 b(cess)381 b(as)g(one)9741 37217 y(of)430 b(gro)-28 b(wth)429 b(and)h(ev)-28 b(olution)432 b(as)e(opp)28 b(osed)430 b(to)h(building)g(and)f(rebuilding)h(b)28 b(ecause)9741 38435 y(most)422 b(complex)g(ob)57 b(jects)422 b(in)f(the)h(real)f(w)-28 b(orld)420 b(are)i(gro)-28 b(wn)419 b(and)i(not)g(built.)696 b(Since)9741 39652 y(soft)-28 b(w)g(are)302 b(design)i(is)g(ob)-28 b(viously)304 b(a)g(complex)h(pro)28 b(cess)303 b(this)h(new)g(paradigm)f(ma)-28 b(y)304 b(b)28 b(e)9741 40870 y(helpful)390 b(in)f(unra)-28 b(v)g(eling)388 b(some)i(of)f(the)g(problems)g(asso)28 b(ciated)390 b(with)f(curren)-28 b(t)387 b(soft-)9741 42088 y(w)-28 b(are)308 b(design)h(practices.)445 b(Demeter)311 b(b)28 b(egins)309 b(b)-28 b(y)309 b(pro)-28 b(viding)309 b(an)f(ideal)i(en)-28 b(vironmen)g(t)9741 43305 y(for)428 b(the)i(sprouting)e(and)h(n)-28 b(uturing)428 b(of)g(a)h(seed)h (\(class)f(dictionary\))h(in)-28 b(to)429 b(a)g(plan)-28 b(t)9741 44523 y(\(large)497 b(scale)f(soft)-28 b(w)g(are)494 b(pro)57 b(ject\).)919 b(In)496 b(addition,)535 b(through)495 b(the)h(com)-28 b(bined)496 b(use)9741 45741 y(of)c(ob)57 b(ject-orien)-28 b(ted)492 b(programming)f(tec)-28 b(hnology)-85 b(,)530 b(and)491 b(parameterized)i(classes,)9741 46958 y(Demeter)323 b(pro)-28 b(vides)321 b(a)h(facilit)-28 b(y)322 b(for)f(the)h(reuse)f(of)g(soft)-28 b(w)g(are)320 b(whic)-28 b(h)321 b(w)-28 b(as)320 b(dev)-28 b(elop)28 b(ed)9741 48176 y(in)342 b(previous)f(soft)-28 b(w)g(are)340 b(pro)57 b(jects.)6974 50168 y Fq(A)369 b(short)g(form)h(of)g(this)f (pap)31 b(er)369 b(w)-31 b(as)370 b(published)f(in)h([LR88)q(].)8634 52604 y Fp(\017)554 b Fq(T)-92 b(o)324 b(app)31 b(ear)324 b(in)g Fk(Journal)354 b(of)g(OBJECT-ORIENTED)f(PR)-28 b(OGRAMMING)p Fq(,)324 b(V)-92 b(ol.1,)9741 53932 y(No.3,)371 b(1988.)25792 68632 y(1)p eop %%Page: 2 2 2 1 bop 6974 4317 a Fj(1)1107 b(INTR)-31 b(ODUCTION)26937 b Fq(2)6974 8192 y Fi(1)1793 b(In)-50 b(tro)50 b(duction)6974 10616 y Fq(The)487 b(primary)g(purp)31 b(ose)486 b(of)i(the)f Fh(D)31 b(emeter)25778 10214 y Fg(T)119 b(M)27890 10616 y Fq(system)488 b(is)e(to)i(pro)-31 b(vide)488 b(a)f(medium)h(for)6974 11944 y(e\016cien)-31 b(t)536 b(gro)-31 b(wth)537 b(and)e(ev)-31 b(olution)538 b(of)d(large)h(scale)f(soft)-31 b(w)g(are)537 b(pro)61 b(jects.)990 b(W)-92 b(e)535 b(describ)31 b(e)6974 13273 y(the)466 b(soft)-31 b(w)g(are)467 b(dev)-31 b(elopmen)g(t)468 b(pro)31 b(cess)464 b(as)i(one)g(of)g(gro)-31 b(wth)467 b(and)f(ev)-31 b(olution)468 b(as)e(opp)31 b(osed)6974 14601 y(to)481 b(building)h(and)f(rebuilding)h(b)31 b(ecause)480 b(most)h(complex)h(ob)61 b(jects)482 b(with)f(few)g(rep)31 b(etitiv)-31 b(e)6974 15929 y(building)371 b(blo)31 b(c)-31 b(ks)369 b(are)g(gro)-31 b(wn)371 b(and)e(not)h(built)g([Mil71)s(])f ([Bro87)r(].)493 b(Examples)370 b(of)g(these)f(are)6974 17258 y(plan)-31 b(t)410 b(and)e(animal)i(life.)611 b(Soft)-31 b(w)g(are,)420 b(b)31 b(eing)409 b(a)g(v)-31 b(ery)408 b(complex)i(creature,)418 b(should)408 b(not)h(b)31 b(e)6974 18586 y(built)306 b(from)f(bits)h(and)f(pieces)f(of)i(inanimate)h(co)31 b(de)305 b(whic)-31 b(h)306 b(is)f(sewn)f(together)i(and)f(sho)31 b(c)-31 b(k)g(ed)6974 19915 y(in)g(to)456 b(life)g(with)g(a)f(marathon) i(session)d(of)i(debugging.)751 b(A)455 b(creature)g(created)g(in)g (suc)-31 b(h)454 b(a)6974 21243 y(fashion)513 b(is)e(assured)g(of)h (sharing)g(the)g(same)g(fatal)i(\015a)-31 b(ws)512 b(as)f(other)h (creatures)g(created)6974 22571 y(in)464 b(this)g(fashion)h(\(e.g.)778 b(the)464 b(F)-92 b(rank)-31 b(enstein)25538 22170 y Ff(1)26498 22571 y Fq(monster\).)778 b(Instead,)488 b(the)464 b(soft)-31 b(w)g(are)465 b(plan)-31 b(t)6974 23900 y(should)486 b(b)31 b(e)485 b(gro)-31 b(wn)487 b(from)f(a)g(small)h(but)e(animate)j (sprout.)842 b(A)-31 b(t)487 b(eac)-31 b(h)486 b(stage)g(of)g(gro)-31 b(wth)6974 25228 y(the)424 b(creature)g(will)i(b)31 b(ecome)425 b(more)f(complex)i(but)f(will)h(alw)-31 b(a)g(ys)426 b(exhibit)g(c)-31 b(haracteristics)6974 26556 y(appropriate)370 b(for)g(that)g(stage)g(of)g(dev)-31 b(elopmen)g(t.)8634 27885 y(Demeter,)370 b(appropriately)h(named)e(for)h(the)f(Greek)f(go) 31 b(ddess)369 b(of)g(the)h(earth,)f(pro)-31 b(vides)6974 29213 y(an)351 b(ideal)h(en)-31 b(vironmen)g(t)352 b(for)f(the)g(plan) -31 b(ting)353 b(of)f(a)f(small)h(protot)-31 b(yp)31 b(e)352 b(system)f(\(sprout\))h(and)6974 30541 y(its)361 b(n)-31 b(urturing)361 b(in)-31 b(to)362 b(a)f(fully)h(dev)-31 b(elop)31 b(ed)362 b(soft)-31 b(w)g(are)362 b(system.)490 b(In)360 b(addition,)365 b(Demeter)c(pro-)6974 31870 y(vides)384 b(the)h(necessary)e(facilities)k(for)d(grafting)j(whole)e (or)f(part)h(of)g(previously)g(dev)-31 b(elop)31 b(ed)6974 33198 y(soft)-31 b(w)g(are)305 b(systems)d(to)i(the)g(new)f(system)g (or)g(ev)-31 b(en)303 b(grafting)j(the)d(new)g(system)g(on)-31 b(to)305 b(a)e(suit-)6974 34526 y(ably)330 b(dev)-31 b(elop)31 b(ed)330 b(ro)31 b(ot)329 b(sto)31 b(c)-31 b(k)330 b(\(a)g(parameterized)g(class\).)480 b(The)329 b(Demeter)g(system)g(creates)6974 35855 y(suc)-31 b(h)299 b(an)i(en)-31 b(vironmen)g(t)302 b(b)-31 b(y)300 b(marrying)h(ob)61 b(ject-orien)-31 b(ted)303 b(programming)f(tec)-31 b(hniques)301 b(with)6974 37183 y(a)431 b(common)i(data)f(structure)e(description)i (language)h(and)f(the)f(concept)g(of)h(parameter-)6974 38511 y(ized)445 b(class.)721 b(Through)446 b(the)g(use)e(of)i(this)g (en)-31 b(vironmen)g(t,)466 b(large)446 b(soft)-31 b(w)g(are)447 b(en)-31 b(vironmen)g(ts)6974 39840 y(can)353 b(b)31 b(e)352 b(gro)-31 b(wn)354 b(from)f(h)-31 b(um)g(ble)354 b(b)31 b(eginnings,)357 b(b)31 b(orro)-31 b(wing)354 b(at)g(eac)-31 b(h)353 b(stage)g(of)g(dev)-31 b(elopmen)g(t)6974 41168 y(the)369 b(exp)31 b(erience)369 b(\(co)31 b(de\))370 b(gained)h(in)e(an)-31 b(y)370 b(previously)g(gro)-31 b(wn)370 b(pro)61 b(jects.)8634 42496 y(The)381 b(Demeter)f(system)h (mak)-31 b(es)381 b(extensiv)-31 b(e)381 b(use)f(of)h(parameterized)h (classes.)525 b(P)-31 b(aram-)6974 43825 y(eterized)434 b(classes)f(are)h(b)31 b(est)433 b(though)-31 b(t)436 b(of)e(as)g(generic)g(soft)-31 b(w)g(are)435 b(mo)31 b(dules)435 b(whic)-31 b(h)434 b(can)g(b)31 b(e)6974 45153 y(used)469 b(and)h(reused)f(b)-31 b(y)470 b(a)g(large)h (assortmen)-31 b(t)471 b(of)f(pro)61 b(jects)471 b(so)e(long)i(as)f (they)h(are)e(of)i(the)6974 46482 y(same)403 b(sp)31 b(ecies.)592 b(W)-92 b(e)402 b(consider)h(the)g(relationship)i(b)31 b(et)-31 b(w)g(een)403 b(parameterized)h(classes)f(and)6974 47810 y(soft)-31 b(w)g(are)338 b(pro)61 b(jects)337 b(to)g(b)31 b(e)336 b(similar)i(to)f(the)g(relationship)h(b)31 b(et)-31 b(w)g(een)337 b(ro)31 b(ot)337 b(sto)31 b(c)-31 b(ks)337 b(and)f(fruit)6974 49138 y(trees.)589 b(A)401 b(ro)31 b(ot)402 b(sto)31 b(c)-31 b(k)402 b(is)g(a)g(tree)f(gro)-31 b(wn)402 b(solely)h(for)e(its)h(ro)31 b(ots.)590 b(The)402 b(v)-61 b(ariet)-31 b(y)402 b(of)g(the)g(tree)6974 50467 y(is)477 b(t)-31 b(ypically)480 b(win)-31 b(ter)478 b(hardy)f(and)h (disease)f(resistan)-31 b(t)478 b(but)f(otherwise)h(unin)-31 b(teresting)479 b(in)6974 51795 y(fruiting)452 b(habit.)739 b(This)451 b(ro)31 b(ot)451 b(sto)31 b(c)-31 b(k)452 b(is)e(used)g(as)h(a)g(strong)g(generic)g(ro)31 b(oting)453 b(system)e(for)6974 53123 y(trees)441 b(of)i(the)f(same)g(sp)31 b(ecies)441 b(whic)-31 b(h)443 b(ha)-31 b(v)g(e)443 b(sp)31 b(ectacular)443 b(fruiting)g(habits)g(but)f(p)31 b(o)g(or)442 b(im-)6974 54452 y(m)-31 b(unit)g(y)455 b(to)e(cold)h(and)f(disease.) 743 b(W)-92 b(e)452 b(graft)i(the)f(desired)g(v)-61 b(ariet)-31 b(y)453 b(on)-31 b(to)455 b(the)e(ro)31 b(ot)453 b(sto)31 b(c)-31 b(k)6974 55780 y(and)383 b(get)h(a)f(sup)31 b(erior)382 b(tree.)534 b(W)-92 b(e)382 b(could)i(ha)-31 b(v)g(e)383 b(pro)31 b(duced)383 b(suc)-31 b(h)382 b(a)i(tree)e(b)-31 b(y)384 b(y)-31 b(ears)382 b(of)i(selec-)6974 57108 y(tiv)-31 b(e)398 b(breeding)f(within)h(the)f(desired)g(v)-61 b(ariet)-31 b(y)-92 b(,)405 b(but)397 b(b)-31 b(y)397 b(using)g(the)g(ro)31 b(ot)397 b(sto)31 b(c)-31 b(k)398 b(w)-31 b(e)397 b(sa)-31 b(v)g(e)397 b(a)6974 58437 y(signi\014can)-31 b(t)439 b(amoun)-31 b(t)438 b(of)g(time.)697 b(The)437 b(parameterized)h (classes)e(of)i(Demeter)e(ha)-31 b(v)g(e)438 b(m)-31 b(uc)g(h)6974 59765 y(in)416 b(common)h(with)g(ro)31 b(ot)416 b(sto)31 b(c)-31 b(ks.)631 b(They)416 b(pro)-31 b(vide)417 b(a)f(base)f(of)h(soft)-31 b(w)g(are)417 b(with)g(some)f(v) -31 b(ery)6974 61093 y(desirable)435 b(prop)31 b(erties.)690 b(W)-92 b(e)434 b(presen)-31 b(t)435 b(sev)-31 b(eral)436 b(clear)f(examples)h(of)g(these)e(constructs)h(in)6974 62422 y(the)369 b(appropriate)i(section)f(b)31 b(elo)-31 b(w.)p 6974 63130 15276 45 v 8206 63846 a Fe(1)8668 64159 y Fd(The)284 b(American)h(Heritage)h(Dictionary)g(de\014nes)e(a)h(F)-78 b(rank)-26 b(enstein)284 b(as)h(\\An)g(agency)g(or)g(creation)h(that) 6974 65210 y(slips)314 b(from)g(the)f(con)-26 b(trol)314 b(of)g(and)g(ultimately)g(destro)-26 b(ys)314 b(its)g(creator".)p eop %%Page: 3 3 3 2 bop 6974 4317 a Fj(2)1107 b(DEMETER)370 b(CLASS)f(DICTIONARIES)h (\(THE)g(SEEDS\))10040 b Fq(3)6974 8280 y Fi(2)1793 b(Demeter)600 b(Class)e(Dictionaries)i(\(The)f(Seeds\))6974 10705 y Fq(All)478 b(large)g(soft)-31 b(w)g(are)479 b(pro)61 b(jects)478 b(should)g(b)31 b(egin)478 b(with)g(a)g(description)g(of)g (the)g(underlying)6974 12033 y(data)325 b(structure.)477 b(It)323 b(is)h(the)f(underlying)i(data)g(structure)e(whic)-31 b(h)324 b(is)g(the)f(bac)-31 b(kb)31 b(one)325 b(of)f(an)-31 b(y)6974 13361 y(soft)g(w)g(are)365 b(system.)490 b(A)364 b(p)31 b(o)g(or)363 b(design)g(at)h(this)f(lev)-31 b(el)365 b(is)e(the)g(shortest)g(road)h(to)g(disaster.)490 b(In)6974 14690 y(Demeter,)379 b(the)e(\014rst)f(step)h(in)g(designing)h(a)f (soft)-31 b(w)g(are)379 b(en)-31 b(vironmen)g(t)379 b(is)d(the)h (construction)6974 16018 y(of)366 b(a)f(class)g(dictionary)-92 b(.)493 b(The)366 b(class)f(dictionary)i(is)e(a)h(natural)g (description)g(of)g(the)f(ob)61 b(ject)6974 17346 y(hierarc)-31 b(hies)343 b(whic)-31 b(h)344 b(mak)-31 b(e)345 b(up)e(the)g (underlying)h(data)g(structure.)484 b(Demeter)343 b(class)g(dictio-) 6974 18675 y(naries)450 b(are)g(de\014ned)h(b)-31 b(y)450 b(an)h(LL\(1\))g(language)i(whose)e(description)g(app)31 b(ears)450 b(in)h(a)f(form)6974 20003 y(similar)338 b(to)g(EBNF.)g(An) -31 b(y)338 b(actions)g(whic)-31 b(h)338 b(are)f(to)h(b)31 b(e)336 b(carried)h(out)h(in)g(the)f(\\program")i(are)6974 21331 y(reduced)421 b(to)h(manipulations)i(of)e(the)g(ob)61 b(ject)423 b(hierarc)-31 b(h)g(y)-92 b(.)650 b(The)421 b(mac)-31 b(hine)423 b(readable)g(data)6974 22660 y(structure)365 b(is)g(automatically)370 b(generated,)e(along)f(with)f(an)g(abundance)g (of)g(supp)31 b(ort)365 b(soft-)6974 23988 y(w)-31 b(are,)381 b(b)-31 b(y)378 b(the)g(Demeter)g(system.)519 b(When)377 b(a)h(user)f(describ)31 b(es)377 b(his)g(or)h(her)f(data)i(structure) 6974 25316 y(abstractly)-92 b(,)326 b(he)313 b(or)g(she)g(gains)h(the)f (adv)-61 b(an)-31 b(tage)316 b(of)d(ha)-31 b(ving)315 b(a)f(common)h(data)f(structure)f(for)6974 26645 y(all)427 b(soft)-31 b(w)g(are)427 b(pro)61 b(jects.)662 b(This)426 b(allo)-31 b(ws)428 b(for)d(the)h(building)i(of)e(a)f(facilit)-31 b(y)429 b(for)d(reusing)f(an)-31 b(y)6974 27973 y(soft)g(w)g(are)428 b(previously)g(written)g(in)f(the)g(Demeter)g(system)g(regardless)f(of) h(the)g(nature)g(of)6974 29302 y(the)369 b(old)h(soft)-31 b(w)g(are)371 b(pro)61 b(ject.)8634 30630 y(The)285 b(Demeter)f(system) h(is)g(curren)-31 b(tly)284 b(implemen)-31 b(ted)287 b(in)e(F)-92 b(ranz)284 b(Lisp/Fla)-31 b(v)g(ors.)465 b(In)284 b(this)6974 31958 y(implemen)-31 b(tation)395 b(an)390 b(ob)61 b(ject)392 b(hierarc)-31 b(h)g(y)391 b(is)f(built)i(out)f(of)g(Fla)-31 b(v)g(or)392 b(instances)f(and)f(ob) 61 b(ject)6974 33287 y(manipulations)471 b(are)c(written)i(as)e(metho) 31 b(d)469 b(de\014nitions.)789 b(The)468 b(Demeter)f(system)h(could) 6974 34615 y(b)31 b(e)421 b(p)31 b(orted)422 b(to)h(an)-31 b(y)423 b(language)h(whic)-31 b(h)423 b(has)f(facilities)i(for)e (de\014ning)h(ob)61 b(jects)423 b(and)f(classes)6974 35943 y(of)450 b(ob)61 b(jects,)472 b(instance)451 b(v)-61 b(ariables)450 b(attac)-31 b(hable)453 b(to)d(an)h(ob)61 b(ject)451 b(or)f(class,)470 b(and)450 b(a)g(m)-31 b(ultiple)6974 37272 y(inheritance)477 b(mec)-31 b(hanism.)814 b(The)476 b(p)31 b(orting)477 b(of)f(the)g(Demeter)g(system)g(to)g(the)g(follo) -31 b(wing)6974 38600 y(languages)347 b(is)e(no)-31 b(w)346 b(under)e(review:)481 b(Ob)61 b(jectiv)-31 b(e-C,)348 b(C++,)j(Common)c(Lisp)e(\(CLOS\),)h(PC)6974 39928 y(Sc)-31 b(heme)369 b(with)i(Sco)31 b(ops)369 b(and)h(Prolog)g(with)h(an)e(ob)61 b(ject-orien)-31 b(ted)372 b(extension.)8634 41257 y(Man)-31 b(y)448 b(complex)g(class)f(dictionaries)h(ha)-31 b(v)g(e)448 b(b)31 b(een)447 b(written,)468 b(tested,)f(and)447 b(dev)-31 b(elop)31 b(ed)6974 42585 y(in)-31 b(to)385 b(full)g(\015edged)g(soft) -31 b(w)g(are)385 b(systems.)538 b(W)-92 b(e)383 b(b)31 b(egin)385 b(b)-31 b(y)384 b(constructing)h(a)g(class)f(dictionary)6974 43913 y(whic)-31 b(h)425 b(represen)-31 b(ts)423 b(a)i(real)f(w)-31 b(orld)426 b(system,)439 b(namely)-92 b(,)439 b(a)425 b(meal.)659 b(W)-92 b(e)424 b(\014rst)g(construct)g(this)6974 45242 y(class)366 b(dictionary)i(in)e(English)i(and)e(then)g(transcrib) 31 b(e)366 b(it)h(in)-31 b(to)368 b(the)e(language)i(of)f(Demeter)6974 46570 y(in)i(order)g(to)h(illustrate)h(the)e(naturalness)h(of)g(the)f (system.)8634 47898 y(A)-31 b(t)287 b(some)f(p)31 b(oin)-31 b(t)287 b(in)g(de\014ning)f(a)g(class)g(dictionary)i(w)-31 b(e)287 b(m)-31 b(ust)286 b(decide)g(what)h(w)-31 b(e)287 b(consider)6974 49227 y(to)314 b(b)31 b(e)313 b(atomic)j(ob)61 b(jects.)475 b(In)313 b(a)g(meal)i(a)f(steak)g(migh)-31 b(t)315 b(b)31 b(e)313 b(considered)g(atomic)j(since)d(w)-31 b(e)314 b(are)6974 50555 y(not)298 b(in)-31 b(terested)298 b(in)g(breaking)h(the)f(meat)g(do)-31 b(wn)299 b(in)-31 b(to)299 b(its)f(molecular)h(structure.)468 b(A)298 b(shrimp)6974 51884 y(co)31 b(c)-31 b(ktail)376 b(migh)-31 b(t)375 b(b)31 b(e)373 b(considered)g(b)-31 b(y)373 b(some)h(to)g(b)31 b(e)373 b(atomic,)k(but)c(for)h(the)f(purp)31 b(ose)373 b(of)g(this)6974 53212 y(example)353 b(w)-31 b(e)352 b(assume)g(that)h(w)-31 b(e)353 b(are)e(ignoran)-31 b(t)354 b(of)e(the)h(notion)g(of)f(a)h(shrimp)e(co)31 b(c)-31 b(ktail)355 b(and)6974 54540 y(need)272 b(to)i(break)e(it)i(do)-31 b(wn)273 b(further.)460 b(A)-31 b(tomic)275 b(ob)61 b(jects)274 b(are)e(presen)-31 b(ted)272 b(as)h(terminal)h(sym)-31 b(b)31 b(ols)6974 55869 y(in)369 b(our)g(grammar)i(\(t)-31 b(ypically)372 b(strings\).)494 b(W)-92 b(e)368 b(de\014ne)h(our)g (meal)h(as)f(follo)-31 b(ws:)8327 58082 y(1.)554 b(A)372 b(meal)i(is)e(an)g(app)31 b(etizer,)374 b(an)f(en)-31 b(tree,)373 b(and)f(a)h(dessert.)501 b(While)372 b(a)h(dessert)e(ma)-31 b(y)373 b(b)31 b(e)9741 59411 y(considered)357 b(optional)j(in)d(man) -31 b(y)358 b(households,)i(w)-31 b(e)358 b(consider)f(it)g(a)g (required)g(part)g(of)9741 60739 y(a)370 b(meal.)8327 62953 y(2.)554 b(An)369 b(app)31 b(etizer)370 b(is)f(a)h(melon)g(or)f (a)h(shrimp)f(co)31 b(c)-31 b(ktail.)8327 65167 y(3.)554 b(A)465 b(shrimp)f(co)31 b(c)-31 b(ktail)467 b(is)d(lettuce,)490 b(one)464 b(or)h(more)f(shrimp,)489 b(and)464 b(p)31 b(ossibly)465 b(co)31 b(c)-31 b(ktail)p eop %%Page: 4 4 4 3 bop 6974 4317 a Fj(2)1107 b(DEMETER)370 b(CLASS)f(DICTIONARIES)h (\(THE)g(SEEDS\))10040 b Fq(4)9741 8192 y(sauce.)8327 10342 y(4.)554 b(Co)31 b(c)-31 b(ktail)372 b(sauce)d(is)h(k)-31 b(etc)g(h)g(up)370 b(and)f(horseradish.)8327 12493 y(5.)554 b(An)369 b(en)-31 b(tree)370 b(is)f(a)g(steak)h(platter)g(or)g(a)f(bak) -31 b(ed)370 b(stu\013ed)f(shrimp)g(platter.)8327 14644 y(6.)554 b(A)369 b(steak)h(platter)h(is)e(a)g(steak)h(and)g(the)f (trimmings.)8327 16795 y(7.)554 b(A)369 b(bak)-31 b(ed)370 b(stu\013ed)f(shrimp)g(platter)i(is)e(a)g(stu\013ed)g(shrimp)g(and)h (the)f(trimmings.)8327 18945 y(8.)554 b(The)370 b(trimmings)h(are)e(a)g (p)31 b(otato)371 b(and)f(t)-31 b(w)g(o)371 b(v)-31 b(eggies.)8327 21096 y(9.)554 b(A)369 b(v)-31 b(eggie)371 b(is)e(carrots,)h(p)31 b(eas,)369 b(or)g(corn.)7773 23247 y(10.)555 b(A)369 b(dessert)g(is)g(pie,)h(cak)-31 b(e,)370 b(or)f(jello.)7773 25398 y(11.)555 b(W)-92 b(e)436 b(assume)g(that)h(the)f(follo)-31 b(wing)440 b(items)d(are)f(atomic)i(and)e(need)g(no)g(further)g(de-) 9741 26726 y(scription:)820 b(melon,)575 b(shrimp,)e(lettuce,)i(k)-31 b(etc)g(h)g(up,)575 b(horseradish,)e(steak,)h(stu\013ed-)9741 28054 y(shrimp,)370 b(p)31 b(otato,)371 b(carrots,)f(p)31 b(eas,)369 b(corn,)h(pie,)g(cak)-31 b(e,)370 b(and)g(jello.)6974 30142 y(The)413 b(decision)g(as)g(to)g(whether)g(an)g(ob)61 b(ject)414 b(is)f(atomic)i(or)d(built)i(up)f(from)g(other)g(ob)61 b(jects)6974 31470 y(is)390 b(not)g(only)h(domain)g(sp)31 b(eci\014c)390 b(but)g(also)g(sp)31 b(eci\014c)390 b(to)g(the)g(p)31 b(erson)389 b(p)31 b(erforming)391 b(the)f(data)6974 32799 y(abstraction.)8634 34127 y(Eac)-31 b(h)380 b(of)g(the)g(elev)-31 b(en)380 b(descriptiv)-31 b(e)380 b(phrases)e(falls)j(in)-31 b(to)380 b(one)g(of)g(three)f(categories.)524 b(Ei-)6974 35455 y(ther)493 b(w)-31 b(e)495 b(are)e(constructing)i(an)f(ob)61 b(ject)495 b(in)f(terms)g(of)g(other)g(ob)61 b(jects)495 b(\(a)f(construction)6974 36784 y(pro)31 b(duction\),)364 b(or)c(w)-31 b(e)360 b(are)g(de\014ning)h(an)f(ob)61 b(ject)362 b(as)d(b)31 b(eing)361 b(an)f(ordered)g(collection)i(of)f (zero)6974 38112 y(\(one\))403 b(or)f(more)h(of)f(another)h(ob)61 b(ject)404 b(\(a)f(rep)31 b(etition)403 b(pro)31 b(duction\),)413 b(or)402 b(w)-31 b(e)402 b(state)h(that)h(an)6974 39440 y(ob)61 b(ject)376 b(is)e(one)g(of)h(sev)-31 b(eral)375 b(p)31 b(ossible)374 b(ob)61 b(jects)376 b(\(an)f(alternation)i(pro)31 b(duction\).)509 b(Examples)6974 40769 y(of)370 b(these)f(three)g(ob)61 b(ject)370 b(descriptions)g(are)f(sho)-31 b(wn)370 b(in)f(Demeter)g (notation)j(b)31 b(elo)-31 b(w.)6974 43046 y Fc(Construction)555 b Fq(An)457 b(elemen)-31 b(t)458 b(of)f(class)g Fb(A)g Fq(has)f(a)h(\014rst)g(part)g(whic)-31 b(h)457 b(is)g(an)g(elemen)-31 b(t)458 b(of)9741 44375 y(class)384 b Fb(B)f Fq(follo)-31 b(w)g(ed)386 b(b)-31 b(y)383 b(an)h(elemen)-31 b(t)384 b(of)g(class)f Fb(C)p Fq(,)h(p)31 b(ossibly)384 b(an)f(elemen)-31 b(t)385 b(of)f(class)f Fb(D)p Fq(,)9741 45703 y(and)370 b(an)f(elemen)-31 b(t)371 b(of)e(class)h Fb(E)p Fq(.)10904 48202 y Fa(A)581 b(=)g(B)g(C)h([D])f(E.)9741 50701 y Fq(A)535 b(construction)h(class)f(ma)-31 b(y)537 b(inherit)e(from)h (another)f(construction)i(class.)990 b(An)9741 52029 y(elemen)-31 b(t)359 b(of)g(class)e(X)h(has)g(a)g(\014rst)f(part)h (whic)-31 b(h)358 b(is)g(an)g(elemen)-31 b(t)359 b(of)f(class)g(X)g (follo)-31 b(w)g(ed)9741 53357 y(b)g(y)443 b(a)g(second)f(part)h(whic) -31 b(h)444 b(is)e(an)h(elemen)-31 b(t)444 b(of)f(class)g(Z)g(follo)-31 b(w)g(ed)445 b(b)-31 b(y)443 b(all)h(parts)e(of)9741 54686 y(class)369 b(A.)10904 57374 y Fa(X)581 b(=)g(Y)g(Z)h(*inherit*)g (A.)6974 60063 y Fc(Rep)35 b(etition)555 b Fq(An)302 b(elemen)-31 b(t)304 b(of)f(class)g Fb(A)f Fq(is)h(a)g(collection)i(of) e(zero)g(\(one\))g(or)g(more)g(elemen)-31 b(ts)9741 61391 y(of)370 b Fb(B)p Fq(.)10904 63890 y Fa(A)581 b(~)g({)g(B)h(}.)10904 65218 y(A)f(~)g(B)g({)h(B)f(}.)p eop %%Page: 5 5 5 4 bop 6974 4317 a Fj(2)1107 b(DEMETER)370 b(CLASS)f(DICTIONARIES)h (\(THE)g(SEEDS\))10040 b Fq(5)6974 8192 y Fc(Alternation)555 b Fq(An)347 b(elemen)-31 b(t)348 b(of)f(class)g Fb(A)g Fq(is)g(either)g(an)g(elemen)-31 b(t)349 b(of)e(classes)g Fb(B)f Fq(or)h Fb(C)g Fq(or)g Fb(D)p Fq(.)10904 10848 y Fa(A)581 b(:)g(B)g(|)h(C)f(|)g(D.)9741 13505 y Fq(If)429 b(the)h(alternativ)-31 b(es)431 b(ha)-31 b(v)g(e)430 b(common)h(prop)31 b(erties,)444 b(w)-31 b(e)430 b(use)f(alternation)j (with)e(im-)9741 14833 y(plied)350 b(inheritance.)487 b(An)349 b(elemen)-31 b(t)350 b(of)g(class)e(A)h(is)g(either)g(an)h (elemen)-31 b(t)350 b(of)f(class)g(B)g(or)9741 16162 y(C)399 b(and)g(b)31 b(oth)399 b(B)f(and)h(C)g(ha)-31 b(v)g(e)399 b(t)-31 b(w)g(o)400 b(parts,)407 b(the)398 b(\014rst)g(b)31 b(eing)399 b(an)g(ob)61 b(ject)400 b(of)f(class)g(X) 9741 17490 y(and)354 b(the)g(second)f(an)h(ob)61 b(ject)355 b(of)f(class)f(Y.)h(\(X)g(and)g(Y)f(are)g(the)h(last)g(t)-31 b(w)g(o)356 b(parts)d(of)h(B)9741 18818 y(and)370 b(C.\))10904 21475 y Fa(A)581 b(:)g(B)g(|)h(C)f(*common*)h(X)g(Y.)6974 24132 y Fq(Man)-31 b(y)444 b(times)g(w)-31 b(e)443 b(w)-31 b(an)g(t)445 b(to)f(add)g(k)-31 b(eyw)g(ords)444 b(to)g(our)f(ob)61 b(ject)444 b(descriptions.)715 b(These)444 b(ma)-31 b(y)6974 25460 y(b)31 b(e)343 b(necessary)f(to)i(satisfy)g(the)g(LL\(1\))g (restriction)g(on)g(the)f(grammar)i(or)e(ma)-31 b(y)345 b(b)31 b(e)342 b(used)h(to)6974 26788 y(\\sw)-31 b(eeten")377 b(the)e(syn)-31 b(tax)376 b(of)g(a)f(class)g(dictionary)-92 b(.)513 b(In)374 b(an)-31 b(y)376 b(ev)-31 b(en)g(t)376 b(they)g(ha)-31 b(v)g(e)376 b(no)f(e\013ect)h(on)6974 28117 y(the)339 b(ob)61 b(ject)340 b(hierarc)-31 b(h)g(y)339 b(descriptions.)483 b(The)338 b(Demeter)h(system)g(guaran)-31 b(tees)339 b(that)h(all)g(user)6974 29445 y(pro)31 b(duced)460 b(co)31 b(de)461 b(is)f(completely)j(shielded)e(from)g(the)g(concrete)g (syn)-31 b(tax.)768 b(This)461 b(implies)6974 30773 y(that)409 b(the)g(input)g(language)h(for)e(an)h(ob)61 b(ject)409 b(hierarc)-31 b(h)g(y)409 b(can)g(b)31 b(e)407 b(mo)31 b(di\014ed)409 b(to)g(the)g(whims)6974 32102 y(of)396 b(the)g(user)e(with)j(no)f(risk)f(to)h(the)g(reliabilit)-31 b(y)399 b(of)d(the)f(system.)572 b(This)396 b(mo)31 b(di\014cation)399 b(can)6974 33430 y(b)31 b(e)424 b(done)h(at)g(an)-31 b(y)425 b(p)31 b(oin)-31 b(t)426 b(in)f(the)g(system)f(dev)-31 b(elopmen)g(t.)661 b(The)425 b(only)h(restriction)f(is)g(that)6974 34759 y(the)372 b(structure)g(of)g(the)g(underlying)h(ob)61 b(ject)374 b(hierarc)-31 b(h)g(y)372 b(m)-31 b(ust)373 b(remain)g(static.)502 b(Belo)-31 b(w)374 b(are)6974 36087 y(examples)392 b(of)g(construction)g(and)f(rep)31 b(etition)393 b(pro)31 b(ductions)392 b(whic)-31 b(h)392 b(demonstrate)g(where)6974 37415 y(concrete)369 b(syn)-31 b(tax)371 b(can)e(b)31 b(e)369 b(inserted)g(in)-31 b(to)370 b(the)g(ob)61 b(ject)370 b(descriptions.)6974 39851 y Fc(Construction)426 b(Pro)35 b(duction)556 b Fq(.)10904 42729 y Fa(A)581 b(=)g("a")h(B)f("followed")i("by")e("a")h(C)13228 44057 y("inherits-from-Q")14390 45385 y(*inherit*)h(Q)13228 46714 y("end-inherit")13228 48042 y(["maybe")f(D)g("!!"])13228 49370 y("followed)h(by")e(E.)6974 52249 y Fc(Rep)35 b(etition)425 b(Pro)35 b(duction)556 b Fq(.)10904 55127 y Fa(A)581 b(~)g("first")h(B)13228 56455 y({"prefix")h("String")f(B)f("suffix"}) 13228 57783 y("terminating".)6974 60661 y Fc(Alternation)425 b(Pro)35 b(duction)556 b Fq(.)10904 63540 y Fa(Fruit)581 b(:)h(Orange)g(|)f(Apple)12066 64868 y(*common*)h("weight")h()f (Number)g("terminating".)p eop %%Page: 6 6 6 5 bop 6974 4317 a Fj(2)1107 b(DEMETER)370 b(CLASS)f(DICTIONARIES)h (\(THE)g(SEEDS\))10040 b Fq(6)8634 8192 y(Man)-31 b(y)398 b(class)g(dictionaries)h(mak)-31 b(e)399 b(use)e(of)h(descriptiv)-31 b(e)398 b(lab)31 b(els)398 b(in)g(their)f(construction)6974 9520 y(pro)31 b(ductions.)467 b(A)292 b(descriptiv)-31 b(e)293 b(lab)31 b(el)294 b(is)e(an)g(iden)-31 b(ti\014er)293 b(whic)-31 b(h)293 b(is)f(enclosed)h(in)f(angle)i(brac)-31 b(k-)6974 10848 y(ets)383 b(and)g(preceeds)e(a)i(giv)-31 b(en)384 b(non)-31 b(terminal.)536 b(The)383 b(sole)h(purp)31 b(ose)381 b(of)j(descriptiv)-31 b(e)383 b(lab)31 b(els)384 b(is)6974 12177 y(to)344 b(rename)f(a)g(sub-ob)61 b(ject)344 b(in)f(the)h(class)f(dictionary)-92 b(.)485 b(This)344 b(renaming)g(is)f(required)g(if)g(t)-31 b(w)g(o)6974 13505 y(\(or)475 b(more\))h(of)f(the)g(same)g(non)-31 b(terminal)477 b(are)e(iden)-31 b(ti\014ed)476 b(on)f(the)h(righ)-31 b(t)475 b(hand)g(side)g(of)g(a)6974 14833 y(construction)408 b(pro)31 b(duction.)605 b(The)407 b(follo)-31 b(wing)410 b(is)d(an)g(example)h(of)f(suc)-31 b(h)406 b(a)h(pro)31 b(duction,)417 b(it)6974 16162 y(de\014nes)368 b(an)i(ob)61 b(ject)370 b(A)g(whic)-31 b(h)370 b(is)f(comprised)g(of)h(t)-31 b(w)g(o)371 b(B's.)8136 18376 y Fa(A)581 b(=)h()g(B)f()i (B.)6974 20589 y Fq(The)320 b(other)f(case)h(in)g(whic)-31 b(h)320 b(descriptiv)-31 b(e)320 b(lab)31 b(els)320 b(are)g(often)g (used)f(is)h(with)g(class)g(terminals.)6974 21918 y(When)294 b(a)h(class)f(terminal)i(is)f(used)f(without)j(a)d(lab)31 b(el)296 b(it)f(is)g(not)g(descriptiv)-31 b(e.)468 b(W)-92 b(e)294 b(use)g(lab)31 b(els)6974 23246 y(to)339 b(mak)-31 b(e)339 b(the)f(ob)61 b(jects)339 b(more)f(self)g(describing.)483 b(The)338 b(follo)-31 b(wing)342 b(example)d(illustrates)g(this)6974 24575 y(p)31 b(oin)-31 b(t.)8136 26788 y Fa(GradeReport)583 b(=)e(Ident)h(Number.)6974 29002 y Fq(is)442 b(not)g(self)g (describing.)711 b(The)442 b(follo)-31 b(wing)445 b(is)d(seman)-31 b(tically)445 b(equiv)-61 b(alen)-31 b(t)444 b(but)e(mak)-31 b(es)443 b(the)6974 30331 y(class)369 b(dictionary)-92 b(,)371 b(and)f(an)-31 b(y)370 b(metho)31 b(ds)370 b(written)g(for)f (it,)i(easier)e(to)h(read.)8136 32545 y Fa(GradeReport)583 b(=)9298 33873 y()h(Ident)9298 35201 y()f (Number.)8634 37415 y Fq(It)381 b(is)f(imp)31 b(ortan)-31 b(t)382 b(to)f(note)g(that)h(the)f(ob)61 b(ject)381 b(stored)f(at)i(a)e (sym)-31 b(b)31 b(ol)381 b(p)31 b(osition)382 b(remains)6974 38744 y(the)397 b(same)h(whether)f(or)g(not)h(it)f(is)g(lab)31 b(eled.)578 b(The)397 b(lab)31 b(els)397 b(are)g(used)g(only)h(for)f (descriptiv)-31 b(e)6974 40072 y(purp)31 b(oses)287 b(and)i(are)f (analogous)j(to)e(the)f(renaming)i(of)f(v)-61 b(ariables.)466 b(Lab)31 b(els)289 b(are)f(also)h(used)f(to)6974 41400 y(o)-31 b(v)g(erride)397 b(instance)g(v)-61 b(ariable)397 b(t)-31 b(yp)31 b(es)396 b(in)g(connection)i(with)g(inheritance)f(in)f (construction)6974 42729 y(or)369 b(alternation)j(pro)31 b(ductions.)493 b(\(W)-92 b(e)369 b(use)g(class)g(and)g(t)-31 b(yp)31 b(e)370 b(as)f(synon)-31 b(yms.\))6974 45164 y Fa(A)581 b(=)g(B)h(