Can the singleton pattern be applied for
I am using the below code
Subject authSubject = null;
authSubject = Security.login(UserName, password);
My question is if it is okay to create the Subject as a singleton and use the same object in subsequent calls? The call Security.login will try to do a login operation. I want to not perform this operation over and over again. Is it advisable to create this object as a Singleton?