Top tag
Next privilege 200 Rep.
See reduced ads
~649 people reached

  • 0 posts edited
  • 0 helpful flags
  • 1 vote cast
comment Why is naming a table's Primary Key column “Id” considered bad practice?
I would agree except for the more tedious to read. I actually prefer reading more descriptive column names and spending less time figuring out what that column actually is for.
comment PHP Aspect Oriented Design
Not quite. Yes there a lot of static method calls but its loosely coupled because the adapters within the methods. Calling PVSession::readCookie() will always call readCookie, but readCookie execution can be adapted elsewhere. Thats how dependencies of class are tested.
comment PHP Aspect Oriented Design
And yes, frameworks like cakePHP and even Wordpress have filters that can be considered AOP like. If I had to differentiate between them I would say these are more flexible in that they can be set to respond on specific events and allow filtering through anonymous functions, instances and static methods. And now debugging of filters. With adapters, there is only one other framework I know that uses adapters in a similar way for completely changing the execution of a class/method.
comment PHP Aspect Oriented Design
Great observations! What you mostly touched up is the intercepting filters design pattern, which can considered to 'encapsulate' the code. If setAdapterTrace needed another parameters, I would make it have a default value which you refered to as the dynamic nature of PHP. I should mention that the point of the trace is purely debugging and adds overhead to the application when turned on. Also the trace cannot be filtered or adapted then their purpose is to track these operations. One of the things I am considering is using DI for traces rather than strictly defining how the trace is performed.