PHP Classes

Modularity

Recommend this page to a friend!

      PHP Classes blog  >  Developing useful app...  >  All threads  >  Modularity  >  (Un) Subscribe thread alerts  
Subject:Modularity
Summary:Dependencies issue
Messages:2
Author:Nasga
Date:2011-08-23 15:31:30
Update:2011-08-26 02:26:29
 

  1. Modularity   Reply   Report abuse  
Picture of Nasga Nasga - 2011-08-24 03:18:38
Hello,

Sorry, but i just discover this post, and i really like your point of view about software coding.

With some experience, it become easy to split each functionality into separate classes / modules but on the other side, on complex application, you can have evil dependencies.
For exemple, in an application, you have :
- user management
- right management (depend of user)
- stats (depend of user / right / userdata)
- userdata (depend of user / right)

With such application it's really hard to pickup a module and use it into another one...
Do you have any tips about this ?

At work, i have dozen of mysql foreign key / php modules and i really feel to loose modularity.

  2. Re: Modularity   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-08-26 02:26:29 - In reply to message 1 from Nasga
I usually separate use case classes and service classes for each module in such way that service classes of one module do not alter directly information managed by another module.

For instance, the rights management module does not alter user records and vice versa.

If for some reason I need to update user records when an action of the rights management module is executed, it needs to call a service class of the user module for that purpose. That will assure that if the user records structure is changed, the rights management module does not need to be updated to change user records.

Just let me know if this explanation was not clear.