posted 18 years ago
Hello ,
I am designing a system which is supposed to be shared across multiple applications .
While authenticating - I am supposed to check :
1 >Is the user present in the database
2 >Is the user active ( "status" field in database )
3 >Is the application active ( "status" field in database )
So one approach I was thinking was -
I would always get a Value Object ( DTO )
This object would have attributes such as -
"isAppPresent" , "isAppActive" , "isUserPresent" , "isUserActive" etc
Based on these attribute values - I would display the appropriate message on the UI
The other option is - write three exception classes - "ApplicationInactive" , "UserInactive" etc
Was wondering - should I throw exceptions and based on my exception logic deal with the situation or look at my Value Object attributes and take a decision ?
Thanks in advance ,
-anagha