Download frequently asked questions

Transcript
Ustlng 1, (cent’d)
addsubpane: (
.~~ield
new
Owrrecsew
CracrdngBloek(.,.);
paneName:‘userNs.meFieM’;
StartGroup;
tabstop;
when #getContents perform #getUserNamm;
when: #textChanged perform #setUserNarne:;
yourself
);
addsubparw (
En@Field new
owner self;
framingBlock ( ...).
paneName:‘paswurdField’;
startGroup;
&lbStop;
when #textChanged perform: #setPassword;
yourseH
);
addsubpane: (
Button new
ownec se~
framingBlock (...);
addsubpacce (
Button new
owne~ selij
framingBlock ( ...).
paneName:‘cancelButton’;
startGmu~
tabstop;
wherx #clicked perform #bcCancel:;
contents: ‘Cancel’;
yourself
);
openOru aliodnl
“Openme up on the given modeL”
self conhol modek aklodel.
seLfopen
aetPaatswo* aPane
%enemted by WindowBuilderfor a pane caUback.”
“’lheuser has changed the password.Tell contiol
about the change.”
self control password: a%ne contents
aetUserName:aPane
paneNamm‘okButton’;
defaultPushButton;
startGroup;
tabStop;
when: #clicked pefircm #bcOk;
contents: ‘Ok’;
yourself
“Genemtedby WindowBuilderfor a pane caUback.”
“Theuser has changed the user name. Tellcontxol
about the change.”
self coni?oluserName:aPane contents
);
in Listing
2, if the user requests the “log-on” command, the In-
terface will send the message #cmtigon
to the control layer.
However, we’re not making these suggestions just to get you
to draw another box and arrow on all your slides. There are at
As can be seen in the method for this message above, the con-
least three considerable
trol layer then packages up the information
These advantages
necessary for the
model to validate the log-on. Should the log-on be successful,
the control layer decides that the application
closes things up. Otherwise,
Admittedly,
to the ICM architecture.
project
and portability.
is at an end and
it decides the user needs to be
notified of the failure. The actual notification
detail and is, therefore, left to the interface.
management,
advantages
fall in the areas of maintenance,
is a presentation
this is a rather simple example. However, we
MAINTENANCE
In our experience
with implementing
highly interactive
appli-
cations, each of the three layers is associated with a different
level of code volatility.
Once a reasonably
solid Model layer
have used the lCM arehkecture, with very satisfying results,
to implement much larger and more complex applications.
has been implemented, it changes very little from version to
version of the application. The code in the Control layer of-
Scalability is not a concern with this technique. In fact, as ap
placations grow in size, this sort of division becomes commen-
may be required to arrive at a solid Control
surately more important.
tained it also changes little between versions. It is usually ex-
ten changes only a little more frequently.
Several more trials
layer, but once ob-
tended rather d-m-s modified.
SEPARATING
THE HOST GUI FROM YOUR
Adding yet another
On Ae other end of the scale, the presentation
an application
APPLICATION
layer to the all your Smallcalk applica-
tions may not sound just like what you were shopping for.
VOL. i,No. 7: h’iAY1992
aspects of
can change very rapidly. These are more of-
ten modified than extended.
The presentation
also bears the
brunt of keeping up with changes in the host GUIS. By sepa-