Print Page | Close Window

hookfunctions and workflow

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2181
Printed Date: 19-Sep-2025 at 11:46am


Topic: hookfunctions and workflow
Posted By: Peer
Subject: hookfunctions and workflow
Date Posted: 22-Sep-2010 at 7:56am
I'm wrestling with some application design issues:

1) Is there a way  to add common behaviour (not only interfaces) but methods, properties to the entity classes. I filled the injected basetype (->BaseEntity) in the EMdesigner and created a developper  partial class with the same name. Point is the propperties of all the subclasses are not available and can't be manipulated at this time

Use case: deletion in UI is captured in VM or BO (or EM) and instead an update is executed (set active = 0). All the tables in the database have an active field.

An other use case :
The Rowversion number should be updated after updating a table.

in other words:
I'm Looking for an appropriate way  to intercept all kinds of events and relay them to all kind of methods. It would be nice to make all kind of hoofunctions which I could implement in the BO or the VM  . The VM is the most logical place for the eventcapturing, the BO for the hookfunctions.

Maybe I look in the wrong direction and should focus on the EM, subclassing / wrapping in helperclass for specific needs

The problem here is we have our own framework in VFP which has  many-many hookfunctions on critical places where every developer can put extra code. There is an Enterprise layer for common enterprise functionality\layout and an applicationlayer for  common application functionality.

A part of our quest is how we re-construct this architecture in DEvForce...

Thanks :)





Replies:
Posted By: WardBell
Date Posted: 22-Sep-2010 at 10:51am
The easiest way to inject custom logic into any generated entity property is with "Property Interceptors". You can write interceptors that leverage your inheritance tree.
 
Here is a DRC (DevForce Resource Center) search with links: http://drc.ideablade.com/xwiki/bin/view/Main/Search?text=interceptor - http://drc.ideablade.com/xwiki/bin/view/Main/Search?text=interceptor  
 
We also have life-cycle events all over the place including entity creation and deletion. You should be able to intercept Delete() call on a sub-class and reroute to toggle the Active flag. You'll have to take care of hiding / showing entities based on that flag.
 
Send us a list of specific VFP hooks that matter to you. We may be able to map those to DevForce functionality. Please focus on the ones that matter :-)



Print Page | Close Window