0 Replies Latest reply: Oct 9, 2013 7:34 AM by Aegis Kleais RSS

    Creating an Object vs simply storing variables

    Aegis Kleais Community Member

      Are there any pro/cons I should be aware of in this case?

       

      My application has users.  I could create a 'user' object with the appropriate properties and methods to hold the logged in user's information, performing things like: user.getName() and user.logout().   But on the other side of the coin, if I wanted to get the name of a user, I could simply have a structure like SESSION.user.name and just retrieve it's value.  And if I wanted to perform a logout, I could simply call the function in my security component and pass the needed info.

       

      I like the idea of using OOP where possible, but is there any issue with going that route vs more simplified non-OOP methodologies?