Hi, I have come across a behaviour which might be of interrest to others and Dr Friedman and associates:
I have a class which is "static" in the JESS sence if you want to make a defclass followed by a definstance on the class. (AddPropertyChangeListener is not supported). When I out of ignorance and incomplete documentation tried to definstance an object of the class without setting one specifically needed property I got an exception back because of the not set property instead of for example a null value. As I understand it JESS tries to get all properties from the added instance when definstancing the instance using a beaninfo class if it exists otherwise assuming that the get<AttributeName> set<AttributeName> convention has been used by the class author. Would a third type of class be of interrest with for example the below syntax? (definstance <tag> <Java object> [static | dynamic | manual] ) (modify <fact-specifier> ( <slot-name> nil)+ [update]) with the meaning that when third argument to definstance is set to manual JESS will NOT try to get the properties other than the class and OBJECT fields. If this would be possible the instance could then later be manipulated from a rule to "fill" it with content if there is dependencies between the fields when it comes to order of setting and getting the fields etc. Of course this would be no problem if you have access to the source code of the class you want to interract with JESS because it could then be altered to avoid this problem but that might not always be the case. My suggestion for the modify command is the addition of a last argument to state that the fact should modify the slots in accordance to the value obtainted through a getter of the property. Because of the nil value for the value slot, the user would have to use two modify commands one for slots which where to be read from the backing instance through getters and one for slots which would instead be written through the setter methods. Maybe it would be of interrest to make it possible to change the dynamic type of a definstance between the three. Comments? /best regards Mikael Rundqvist -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
