Hi Hasanthi, On Tue, Jan 23, 2018 at 10:54 PM, Hasanthi Purnima Dissanayake < hasan...@wso2.com> wrote:
> 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. > Can you explain the need of a event mechanism for these use cases.. What are the problems that we try to overcome using the new method? Thanks, > 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: hasan...@wso2.com > M :0718407133| http://wso2.com <http://wso2.com/> > -- Regards, *Darshana Gunawardana*Technical Lead WSO2 Inc.; http://wso2.com *E-mail: darsh...@wso2.com <darsh...@wso2.com>* *Mobile: +94718566859*Lean . Enterprise . Middleware
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev