Advanced Application Framework quick introduction
=================================================


What is it good for:
--------------------

Advanced Application Framework (AAF) can be used for developing usual business applications (not a program for space shuttle). It enhances Visual Works Application Framework in similar ways as VRGoodies and Tim Howard's Extended Application Framework do, but provides very many means and tools.



Installation:
-------------
Smalltalk version: NC 3.0 and NC 3.1 (tested). Not tested with NC 5i.

Prerequisites - AAF needs Refactoring Browser to support certain capabilities. If you don't have it yet, you can get it at st-www.cs.uiuc.edu archive (HTTP). BTW, Refactoring Browser is a REALLY GREAT TOOL and it's a good idea to have it and to use it.

Installation itself:

1) unpack the archive to your "image" directory
The directory structure should look like:

        \vw31\image
                \startup
                \aaf-parcels
		    \examples

2) File in install.st.

3) There will be a dialog window asking you to fill in name of directory containing AAF installation. For the directory structure depicted above, type in \vw31\image.

4) Script files in the following parcels:
	* deadly needed:
		BOSS
		TabControl

* not really needed, but definitely helpful for user-friendly environment (hot-key layout etc). I have included them because I expect a lot of people to have them in their images anyway:
		'UIMenuEditor'
		'Programming Hacks'
		'UIPainter'
		'EditKeys'
		'ColorEditing'
		'BrowserChangeSetEditing'
	* bunch of AAF parcels
	* bunch of parcels that are not really needed for described functionality, but they enhance the development environment. The most remarkable are Goodies-Performance Feel Policy, which changes some text editor keys, and Goodies-Keyboard Mapping, which adds some hotkeys (see parcel's comment and KeyboardProcessorMapper>>initializeMap). It is advisable (but not needed) to have Full Browser parceled in, since these parcels add some utility code to it.

HEED: Parcel Goodies-Performance Feel Policy defines a feel policy which redefines the brak-key to CTRL+B (liek BREAK).



Application structure:
----------------------

AAF Application is required to have a domain model, which can be connected to an Application Model, which in turn may be connected to many user interface windows.

Domain model (DM)
-----------------
It can print itself, compare itself with other objects etc. You don't have to write code for this, there is a tool to do it for you (Launcher -> Tools -> Advanced Application Framework -> Define new domain model...
Two concepts have been added:

1) RULES:
   DM can specify rules, which may be direct translation of business rules to Smalltalk. Rules have the following capabilities:

   * can be added/removed/modified while application is running. You can do this using special visual tool
   * can be temporarily switched on/off
   * are grouped to set of rules (I call it a RuleGuard)
   * rules are invoked prior to DM state change (pre-write) and after it (post-write), and so implement a frame-like computational model
   * which rule will be invoked depends on:
      * state of the domain model (inner polymorphism)
      * identity or some property of the sender of the message causing state change (subjectivity)

2) ADAPTORS
Here I don't mean adaptors used for connecting UI to a DM, but adaptors used for connecting DM to its aspects. In AAF, aspects of a DM may not be its instance variables. An adaptor approach is used - DM owns an adaptor, which owns an adaptor, which owns an adaptor, etc. ... which owns the real data. The strength of this schema lays in that functionality, which is a property of the aspect rather then the entire DM, is kept with the aspect. Each adaptor has capability of changing the data being passed through it in some way. A simple example: a DM is dirty, if any of its aspects have been changed (see AAFDirtinessAdaptor), an aspect may know its last values (see AAFUndiongAdaptor) etc. Important: no code in the DM class needs to be modified if aspect behavior change is needed - you just include some adaptors, which are components. There's a visual tool for this (Launcher>>Tools->Advanced Application Framework->Define new domain model...).



Application model (AM)
----------------------
Standard ApplicationModel class is subclassed "like a lot". Basic features (there are more - see class comments and methods) the subclasses provide are:

  * you don't lose builder of an old window if you open a new window. A set of #disable: aWidgetIDSymbol, #enable: aWidgetIDSymbol and similar methods has been defined. These methods change state of widget named aWidgetIDSymbol in all windows open on the application model simultaneously,

  * you can define a "robot" to manipulate a widget or do other stuff when some aspect's value changes or something else happens. This puts "condition" and "action" code together and is easier to maintain than onChangeSend:to:. It has other properties, explained in method comments. I saw this idea somewhere ... I really don't remember where. Sorry - if you are the author, let me know!!!

  * like Extended Application Framework, AAF includes messaged like hide:if: etc.,

  * visual state of the interface is driven by a domain model. Every aspect in the DM can specify whether it's values has sense (if not, all widgets displaying it are hidden), and whether it's value can be modified (if not, all widgets displaying it are disabled). You may say that DM is knowing UI stuff, but I have to oppose. See the code (AAFVisualAdaptor class) and total distinction between DM and AM stuff will be clear. I found an application in which this saved a LOT of REALLY MESSY coding,

  * in the previous paragraph I used terms "hide" and "disable". In fact, you may specify what these actions are, for each AM, its windows or particular widgets separately. This may be useful for user customization, application internationalization etc. You certainly may open more windows (local and remote over the net, for example), and they will all look the same at all times (see AAFVisualAdaptor and AAFVisualUpdatePolicy class comment).

less important:
  * widow icon setting stub
  * instance creation protocol - nifty
  * directory/file choose dialogs and a lot of common use dialogs
  * obtaining various system information (about screen, platform, environment, ...) using AM methods
  * transient dialogs (like "please wait ..." dialog)
  * common block evaluation protocol - see {block deferred evaluation} protocol of class AAFGeneralServicesApplicationModel
  * open windows at specific location (even modifiable by the screen size)
  * open windows as dialogs (provides hookups for #accept and #close)
  * open single instances of application windows
  * collapse, lower, raise, hide, show etc. windows
 	* all windows
	* windows created from a given window spec method
  * when the last window closes, it can release its application model
  * sophisticated window creation process with lot of customization points (not only {pre|post} {build|open} With:
  * DM can specify if it's in a valid or invalid state, UI can adjust accordingly (one method coding needed to utilize it)
  * lots of others (commented in code)


Legal:
------

Copy it, print it (:-))), use it, play with it, but don't sell it and don't say that all this crap is yours :-).

This is version 1.0. If there is enough interest from Smalltalk community, I'll fix some errors I know of, add some more nifty things I have in mind and release it again.


Word about author:
------------------
Name: Petr Stepanek
Email: petr.stepanek@email.cz
http://petr.kytara.cz

Do not hesitate to send all comments, critique etc. to petr.stepanek@email.cz. All emails will be replied to, but after 2/22/00, since on that day I am to defend AAF as my MS thesis and undertake a HUGE exam, for which I have to study HARD. So do not expect any dialog before 2/22/00 :-)


Credits:
--------
First of all, I'd like to thank all people from the old PARC team for developing Smalltalk and thus enabling me to do my thesis and other programming in a really pleasant way. Then to my tutor, Vojtech Merunka, who is a great smalltalker (see http://omega.pef.czu.cz/pef/ki/oo/start.html - perhaps the best Smalltalk pages in central Europe, most of them in English). Then, I'd like to thank all of the following smart guys for their books and articles that had influenced me and AAF much, esp. (in no particular order) Bobby Woolf, Kyle Brown, Ralph E. Johnson, Susan Griffin, Bob Hinkle and Tim Howard.

Literature list in alphabetical order, including little literature in Czech:

[1] Abadi M., Cardelli L.: A Theory of Primitive Objects, in Proceedings of ESOP93 - European Symposium on Programming, Springer Verlag, 1994.

[2] Alpert S., Brown K., Woolf B.: The Design Patterns Smalltalk Companion, Addison-Wesley, New York, NY, USA, ISBN: 0-20-118462-1.

[3] Anderson E., Reenskaug T.: System Design by Composing Structures of Interacting Objects, Technical Report, Department of Informatics, University of Oslo, 1991, ftp://ftp.ifi.uio.no/pub/rolem/RoleModeling.ps.Z.

[4] Beck K.: Smalltalk best practise patterns, Prentice Hall, New York, NY, USA, 1996, ISBN: 0-13-476904-X.

[5] Beck K.: Smalltalk idioms: A short introduction to a pattern language, In Smalltalk Report, 5(2), 1993, ISSN: 1056-7976.

[6] Beck K.: Smalltalk idioms: Value model idioms, In Smalltalk Report, 1(2), 1992, ISSN: 1056-7976.

[7] Beck K.: Smalltalk idioms:To accessor or not to accessor?, In Smalltalk Report, 8(2), 1993, ISSN: 1056-7976.

[8] Brant J. M.: HotDraw - Object Oriented System using Constraint Programming, Thesis of J.M. Brant, University of Illinois, IL, USA, Dept. of Computer Science.

[9] Brown K. Understanding inter-layer communication with the SASE pattern, In Smalltalk Report, 3(5), 1995, ISSN: 1056-7976.

[10] Brown K.: GUI Smalltalk: the VisualWorks UIBuilder, In Smalltalk Report, 8(3), 1994, ISSN: 1056-7976.

[11] Brown K.: Rememberence of things past: layered architectures for Smalltalk applications, In Smalltalk Report, 9(4), 1995, ISSN: 1056-7976.

[12] Cant M.: Delphi 4: Podrobn prvodce programtora, Grada, Praha, 1999, 638 s, ISBN: 80-7169-800-8.

[13] Cant M.: Mistrovstv v Delphi, Dl 1, Computer Press, Praha, 1996, 870 s., ISBN: 80-85896-42-7.

[14] Cant M.: Mistrovstvi v Delphi, Dl 2, Computer Press, Praha, 1996, v, s. 874-1310, ISBN: 80-85896-42-7.

[15] Cox B. J.: Object Oriented Programming - An Evolutionary Approach, Addison-Wesley, New York, NY, USA, 1986, ISBN: 0-201-10393-1.

[16] Davidowitz P.: Externalizing business - object behavior: more on a point-and-click rule editor, In Smalltalk Report, 2(6), 1996, ISSN: 1056-7976.

[17] Deugo D., Beaton W.: Visual programming: managing connection complexity, In Smalltalk Report, 1(6), 1996, ISSN: 1056-7976.

[18] Deugo D., Beaton W.: Visual programming: Reusable components, In Smalltalk Report, 9(5), 1996, ISSN: 1056-7976.

[19] VisualWorks 3.1 doc, HTTP://www.cincom.com:
VisualWorks 3.1 / Smalltalk-80, User's Guide, Cincom Systems, Inc.
VisualWorks 3.1 / Smalltalk-80, Cookbook, Cincom Systems, Inc.
VisualWorks 3.1 / Smalltalk-80, Tutorial, Cincom Systems, Inc.
VisualWorks 3.1 / Smalltalk-80, Object Reference, Cincom Systems, Inc.

[20] Foote B., Johnson R. E.: Reflective Facilities in Smalltalk-80, Internal paper of Dept. of Computer Science, University of Illinois at Urbana-Champaign, IL, USA, 1993.

[21] Gamma E., Helm R., Johnson E. R., Vlissides J.: Design Patters - Elements of Reusable Object Oriented Software, Addison-Wesley, New York, NY, USA, 1996, ISBN: 0-201-63361-2.

[22] Griffin S.: What if? A protocol for object validation, In Smalltalk Report, 3(3), 1993, ISSN: 1056-7976.

[23] Halvorson M.: Microsoft Visual Basic 6.0 Professional: Krok za krokem, Computer Press, Brno, 1999, 545 s., ISBN: 80-7226-169-X.

[24] Hendley G., Smith E.: Separating the GUI from application, In Smalltalk Report, 2(2), 1992, ISSN: 1056-7976.

[25] Hinkle B., Johnson R. E.: Deep in the Heart of Smalltalk: The active life is the life for me!, In Smalltalk Report, 7(5), 1996, ISSN: 1056-7976.

[26] Hopkins T., Horan B.: Smalltalk - An Introduction to Application Development Using VisualWorks, Prentice Hall, New York, NY, USA, 1995, ISBN: 0-13-318387-4.

[27] Howard T., Kohl B.: Extending the application model, In Smalltalk Report, 7(3), 1994, ISSN: 1056-7976.

[28] Howard T.: Segregating application and domain, Part 1, In Smalltalk Report, 7(4), 1995, ISSN: 1056-7976.

[29] Howard T.: Segregating application and domain, Part 2, In Smalltalk Report, 8(4), 1995, ISSN: 1056-7976.

[30] Howard T.: Segregating application and domain, Part 3, In Smalltalk Report, 9(4), 1995, ISSN: 1056-7976.

[31] Howard T.: VisualWorks dialog development, In Smalltalk Report, 6(4), 1995, ISSN: 1056-7976.

[32] Johnson E. R., Opdyke W.: Creating Abstract Superclasses by Refactoring, Technical Report, Department of Computer Science, University of Illinois at Urbana-Champaign, IL, USA.

[33] Johnson E. R.: Documenting Frameworks using Patterns, OOPSLA '92 Proceedings, SIGPLAN Notices, 27(10), pp. 63-76, Vancouver BC, October 1992.

[34] Johnson R. E., Foote B.: Designing reuseable classes, Technical Report, Department of Computer Science, University of Illinois at Urbana-Champaign, IL, USA, 1998, http://st-www.cs.uiuc.edu/users/johnson.

[35] Johnson R. E., Russo V. F.: Reusing object-oriented design, Technical Report, Department of Computer Science,University of Illinois at Urbana-Champaign, IL, USA, UIUCDCS 91-1696, 1991.

[36] Johnson R. E.: Components, Frameworks, Patterns, Technical Report, Department of Computer Science, University of Illinois at Urbana-Champaign, IL, USA, 1997, http://st-www.cs.uiuc.edu/users/johnson.

[37] Johnson R. E.: How to design frameworks, Notes for OOPSLA, Department of Computer Science, University of Illinois at Urbana-Champaign, IL, USA, 1993, http://st-www.cs.uiuc.edu/users/johnson.

[38] Johnson R. E.: How to develop frameworks, Notes for Smalltalk Solutions, Department of Computer Science, University of Illinois at Urbana-Champaign, IL, USA, http://st-www.cs.uiuc.edu/users/johnson.

[39] Kirkpatrick D.: Tactical patterns for the real world - optimization patterns, In Smalltalk Report, 8(5), 1996, ISSN: 1056-7976.

[40] Kirkpatrick D.: Tactical patterns for the real world - validation and informational patterns, In Smalltalk Report, 7(5), 1996, ISSN: 1056-7976.

[41] Klimas J., Skublics S., Thomas D.: Smalltalk with style, Prentice Hall, New York, NY, USA, 1996, ISBN: 0-13-165549-3.

[42] Krasner G. E., Pope S. T.: A Cookbook for using model-view-controller user interface paradigm in Smalltalk-80, The Journal of Object-Oriented Programming, 1(3), 1988, ISSN: 0896-8438.

[43] Krasner G. E., Pope S. T.: A Description of the model-view-controller - user interface paradigm in the Smalltalk - 80 system, ParcPlace System Technical Report, ParcPlace System, 1988, http://www.parcplace.com/doc.

[44] Kvoch M.: Programovn ve Visual Basicu 3.0, Kopp, eske Budjovice, 1995, 234 s, ISBN: 80-85828-51-0.

[45] Kvoch M.: Programovn ve Visual Basicu 4.0, Kopp, eske Budjovice, 1996, 298 s, ISBN: 80-85828-64-2.

[46] LaLonde W., Pugh J.: Subclassing ~= subtyping ~= is-a, The Journal of Object-Oriented Programming, 1991, 4(1), ISSN: 0896-8438.

[47] LaLonde, W., Pugh J.: Information holders: A framework for building user-interface driven applications, In The Journal of Object-Oriented Programming, 8(5), 1993, ISSN: 0896-8438.

[48] Leibs D. J., Rubin K. S.: Model-view-controller, In Smalltalk Report, 6(1), 1992, ISSN: 1056-7976.

[49] Liu, C.: Smalltalk, objects and design, Manning Publications Company, Greenwich, CT, USA, 1996, ISBN: 1-884777-27-9.

[50] Merunka V., Polk J.: vod do objektov orientovanho paradigmatu, Olomouc - sbornk semine Programovn 1996.

[51] Merunka V., Vak T.: Zkuenosti s objektov orientovanm pstupem pi tvorb aplikac, Tvorba softwaru 1996, Ostrava - sbornk konference, pp 83-95.

[52] Merunka V.: Business Object Relation Modeling, Tvorba softwaru 1999 - sbornk konference pp. 202-214, ISBN: 8-08-598839-9.

[53] Merunka V.: Objektov orientovan programovn v systmu Smalltalk, uebn text ZU, 1992.

[54] Meyer B.: Object-Oriented Software Construction, Prentice Hall, New York, NY, USA, 1296 s, 1997, ISBN: 0-13-629155-4.

[55] Microsoft Visual C++. Vol. 1., Visual C++, Microsoft Press, Redmond, WA, USA, 491 s, 1994, ISBN: 1-55615-800-9.

[56] Odell J. J.: Specifying requirements using rules, In The Journal of Object-Oriented Programming, 2(6), 1993, ISSN: 0896-8438.

[57] Opdyke W.: Refactoring Object Oriented Frameworks, Thesis of W. Opdyke, University of Illinois, IL, USA, Dept. of Computer Science, 1992.

[58] Polk J., Merunka V.: Zkladn principy objektov orientovanho paradigmatu, Programovn 1993, Ostrava - sbornk semine, pp 24-50.

[59] Sharp A.: Smalltalk by Example, McGraw-Hill, New York, NY, USA, 1997, ISBN: 0-07-913036-4.

[60] Smkal L.: Podpora vizulnho programovn v objektovch systmech, sbornk konference Objekty '99, ZU Praha, 1999, s.135-142.

[61] The Unified Modeling Language Documents, Rational Software Corporation, http://www.rational.com/ot/uml.html.

[62] Woolf B.: A Hierarchy that acts like a class, In Smalltalk Report, 4(5), 1996, ISSN: 1056-7976.

[63] Woolf B.: A Strategy for using instance variables, In Smalltalk Report, 8(5), 1996, ISSN: 1056-7976.

[64] Woolf B.: Equality versus identity, In Smalltalk Report, 7(5), 1996, ISSN: 1056-7976.

[65] Woolf B.: How to display an object as a string: printString and displayString, In Smalltalk Report, 9(5), 1996, ISSN: 1056-7976.

[66] Woolf B.: How to display an object as a string: TypeConverter and PrintConverter, In Smalltalk Report, 1(6), 1996, ISSN: 1056-7976.

[67] Woolf B.: Improving dependency notification, In Smalltalk Report, 3(4), 1994, ISSN: 1056-7976.

[68] Woolf B.: Making MVC code more reusable, In Smalltalk Report, 4(4), 1995, ISSN: 1056-7976.

[69] Zaratian B.: Microsoft Visual C++ 6.0: Pruka programatora. Nepostradateln prvodce programovanm v Microsoft Visual C++ 6.0, Computer Press, Praha, 1999, 614 s., ISBN: 80-7226-151-7.
