Can't we just return null from getUser() if the user doesn't exist? Throwing an exception for a non-exceptional flow is a performance hit.
On Fri, Jan 27, 2017 at 1:07 PM, Johann Nallathamby <[email protected]> wrote: > Hi Lahiru, > > Unless its really required for your business logic you should avoid > checking if user exists all the time. If user does not exist you will get > an exception and you can handle it. You should not be compromising best > case performance. I know we've done this mistake in several places in C4. > We should be careful in C5. > > I will let the others to comment on if there are optimal ways to retrieve > the user. > > Regards, > Johann. > > On Fri, Jan 27, 2017 at 12:58 PM, Lahiru Manohara <[email protected]> > wrote: > >> Hi, >> >> We can use getUser method to check whether the user exists in user >> stores. But do we have any optimized method to do this operation? >> >> Best Regards, >> -- >> *Lahiru Manohara* >> *Software Engineer* >> Mobile: +94716561576 >> WSO2 Inc. | http://wso2.com >> lean.enterprise.middleware >> > > > > -- > Thanks & Regards, > > *Johann Dilantha Nallathamby* > Technical Lead & Product Lead of WSO2 Identity Server > Governance Technologies Team > WSO2, Inc. > lean.enterprise.middleware > > Mobile - *+94777776950* > Blog - *http://nallaa.wordpress.com <http://nallaa.wordpress.com>* > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > > -- *Best Regards* *Rushmin Fernando* *Technical Lead* WSO2 Inc. <http://wso2.com/> - Lean . Enterprise . Middleware mobile : +94775615183
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
