WASystemConfiguration

First, please avail yourself of this excellent tutorial and description and a page taken from the newsgroup by Avi.

I'll wait.

Great, now that you have that under your belt, the following should be trivial to understand.

First, we create a subclass of WASystemConfiguration called TGGoodsConfiguration. In this new class we need only override #attibutes as follows:

attributes
    ^ Array with: (WAStringAttribute key: #dbHost group: #goods) 
                with: (WAStringAttribute key: #dbPort group: #goods)

Set the default values:

dbHost
    ^ 'localhost'
dbPort
    ^ 6100

Also, don't forget to put this class as an Ancestor of your application!

Back on our session class:

dbHost
      ^self application preferenceAt: #dbHost
dbPort
      ^self application preferenceAt: #dbPort

Go Back