DEV Community

[Comment from a deleted post]
Collapse
 
wudo profile image
Martin Hájek

In these cases I do like OOP approach better. Like from userHasAdminRole(user); to user.hasAdminRole():

Collapse
 
jochemstoel profile image
Jochem Stoel

That is not an OOP approach. OOP means instantiate a user and call a hasAdminRole() method on it. :P

Collapse
 
bgadrian profile image
Adrian B.G.

This is how classes and hierarchies gets bloated.

Sounds great in theory but maybe administration rights and server may end up in different classes and systems.

One thumb of rule state to not make a method if you do not modify the object by reference.