next up previous
Next: Consequences Up: External Polymorphism An Object Previous: Structure and Participants

Collaborations

The External Polymorphism pattern is typically used by having an external client make requests through the polymorphic Common*. The following is an interaction diagram for this collaboration. bbllxfalse bbllyfalse bburxfalse bburyfalse heightfalse widthfalse rheightfalse rwidthfalse p@sbbllxp@sbblly p@sbburxp@sbbury p@sheightp@swidth p@srheightp@srwidth p@sfile p@scost10 sc prologfilefalse postlogfilefalse clipfalse psdopsfiga:=figure=graphics/oid.eps,width=8.5cm setparmspsfiga, @bbfalse @bbllx @bbtrue @bblly @bbtrue @bburx @bbtrue @bbury @bbtrue @bb @stream=p@sfile @bbtrue @eoftrue `%=12

@stream to @in 200=@in @stream @eoffalse bbtest200 @bbmatch@eoffalse@cull200 @eof `%=14 @bb -bb-error

203=p@sbburx 204=p@sbbury 203 by -p@sbbllx 204 by -p@sbblly bbw203 bbh204 @height @width

240=bbw 241=bbh 100=240 100 by 241 101=100 101 by 241 240 by -101 240 by 10 101=240 101 by 241 102=101 102 by 241 240 by -102 240 by 10 102=240 102 by 241 200=p@sheight205=0 201=200 201 by 100 205 by 201 201=200 201 by 10 201 by 101 205 by 201 201=200 201 by 100 201 by 102 205 by 201 result205 p@swidthresult

@width 240=bbh 241=bbw 100=240 100 by 241 101=100 101 by 241 240 by -101 240 by 10 101=240 101 by 241 102=101 102 by 241 240 by -102 240 by 10 102=240 102 by 241 200=p@swidth205=0 201=200 201 by 100 205 by 201 201=200 201 by 10 201 by 101 205 by 201 201=200 201 by 100 201 by 102 205 by 201 result205 p@sheightresult

p@sheightbbh p@swidthbbw

@rheight p@srheightp@sheight @rwidth p@srwidthp@swidth p@scost<psdraft

@clip

@prologfile

@postlogfile

to p@srheight true sp to p@srwidth true sp

to p@srheight true sp

to p@srwidth true sp

p@sfile

Many applications of the External Polymorphism pattern maintain a collection of objects over which the program iterates, treating all collected objects uniformly. Although this is not strictly part of the pattern, it is a common use-case that bears mentioning.



Chris Cleeland
Tue Oct 22 01:20:58 CDT 1996