I've always been told that be very careful when creating static classes, as they tend to abuse less experienced programmers.
I am currently writing a session class in PHP to track a user on a site.
It seems that the session makes sense to be in a static class, because only one of them will be correct?
I worked in CMS with a factory that created a session object, but then saved the instance, and when a new session was requested (MyFactory :: getSession ()), it will return the previously initialized one. Is there any advantage to this?
Thank!
source
share