Hi All,

Requirement :
We have a requirement to insert/update or delete a row from a db table once
access token or authorization code is generated, revoked, code or token
status changed or a refresh token is issued. Without directly invoking the
db, we thought of implementing events to trigger when one of the above
scenario happens. So the existing architecture is kind of service layer is
responsible of issuing/revoking/deleting tokens or codes and this layer is
directly invoking the DAO layer for db calls. So we have two places to
implement events in the service layer or the DAO layer.

Problem :
If we are implementing the events in the service layer, then we have to
trigger multiple events in multiple places as we are doing above operations
in multiple places in the service layer. Also some of the service layer
classes are extensible so we cannot guarantee that a third party extension
developer will implement the events in the extended code.

If we are implementing the events in the DAO layer, then the DAO layer
isolation will be violated.

Ideally there should be a middle layer in between the service layer and the
DAO layer for such kind of situations. As we don't have such a middle
layer, ATM we have implemented the events in the DAO layer.

Highly appreciate any feedback on above.

Thanks,

-- 

Hasanthi Dissanayake

Senior Software Engineer | WSO2

E: [email protected]
M :0718407133| http://wso2.com <http://wso2.com/>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to