gnue-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUe-dev] Proposal for 'bound procedures' in AppServer


From: Johannes Vetter
Subject: [GNUe-dev] Proposal for 'bound procedures' in AppServer
Date: Wed, 19 May 2004 10:12:08 +0200

Hi,

in the following I'd like to describe the 'bound procedures' called by
AppServer. A bound procedure could be seen as an event fired by
AppServer on special situations. Every business object class can
introduce an implementation for these events. If such an implementation
is available it will be executed on the proper situation.

We thought the following events would be ok:

OnInit:
-------
Whenever a new instance of a business object is created an OnInit-Event
will be fired. The procedure-code can refer to the newly created
instance via 'self'. This event could be used for setting
default-values.


OnChange (propertyName, [newValue]):
------------------------------------
Fired whenever a property of a business object class changes. A
procedure can refer to the business class instance via 'self'. The
parameter 'propertyName' describes the property to be changed, and
'newValue' holds the new Value the property should be set to. One can
use the function 'Abort' to prevent a modification of the property.

NOTE: we're trying to eliminate this 'newValue' parameter and make it
available via the procedures namespace (i.e. as a variable 'newValue');
this way we can avoid troubles with 'typeless' parameters.


OnValidate:
-----------
This event will be fired before a commit. It can be used to validate a
business class instance, which can be refered via 'self'. To prevent
further validations and to stop the commit one can use the function
'Abort' or raise another Exception.

OnDelete:
---------
This event will be fired before a business class instance is deleted. A
procedure can refer to this instance via 'self'.



How to add implementations of such events:
------------------------------------------

This is done by adding procedures with given names to the class
definitions. Examples:

address_person.address_OnInit
address_person.sales_OnInit

address_person.address_OnChange
address_person.orders_OnChange

hotline_customer.sales_OnDelete


Invocation:
--------------------
AppServer calls all procedures of a given type in random order. In the
examples above you cannot determine if 'address_person.address_OnInit'
is called before 'address_person.sales_OnInit' or vice versa, but
AppServer will call both procedures on the 'OnInit' event.

If there are multiple implementation of the same event, invocation stops
on the first exception. If the OnChange-events in the example above
would be called in this order and 'address_OnChange' raises an
Exception, 'orders_OnChange' won't be executed.




Please feel free to give us some feedback on these thoughts.

Thanks,

Johannes Vetter


-- 
BYTEWISE Software GmbH          Tel +43 (5577) 89877-0
i.A. Johannes Vetter            Fax +43 (5577) 89877-66
A-6890 Lustenau, Enga 2         http://www.bytewise.at
-------------------------------------------------------
Wir bieten die Installation von Debian GNU/Linux auf
Servern für kleinere Netzwerke zum Pauschalpreis an.
Mehr dazu unter http://www.bytewise.at/texte/pl-debian

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]