You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I understand, psr/cache dont' want to accept the idea of cache optionality. I will try to explain why optinality is a good idea.
Ok, let's talk about MySQL server.
As far as I'm concerned, MySQL server is good example of proper design.
According to this article you may see that cache is optional. It doesn't matter whereas user enabled it or not. The result of the query will be the same in any case.
From user's point of view the cache is not always needed. It's an optimization, infrastructure layer tool. When we design system -- we dont' start from optimization, we start from domain logic and then after some time, when we find bottlenecks, we optimize 'em. So from scratch we allow class's user to use it without any cache-setup issues out of the box. It's a friendly design. Same as we see in great PSR/Log.
Testability of objects with injected cache is an issue. What it should take? Some real pre-cleaned cache pool or home-grown null implementation?
The main advantage of null object implementation is that it's behaviour is do nothing. In case of cache pool it's just never hit/get/save behaviour. There is one way to do it.
The text was updated successfully, but these errors were encountered:
As I understand, psr/cache dont' want to accept the idea of cache optionality. I will try to explain why optinality is a good idea.
Ok, let's talk about MySQL server.
As far as I'm concerned, MySQL server is good example of proper design.
According to this article you may see that cache is optional. It doesn't matter whereas user enabled it or not. The result of the query will be the same in any case.
It means that null-cache is a good idea.
From user's point of view the cache is not always needed. It's an optimization, infrastructure layer tool. When we design system -- we dont' start from optimization, we start from domain logic and then after some time, when we find bottlenecks, we optimize 'em. So from scratch we allow class's user to use it without any cache-setup issues out of the box. It's a friendly design. Same as we see in great PSR/Log.
Testability of objects with injected cache is an issue. What it should take? Some real pre-cleaned cache pool or home-grown null implementation?
The main advantage of null object implementation is that it's behaviour is
do nothing
. In case of cache pool it's justnever hit/get/save
behaviour. There is one way to do it.The text was updated successfully, but these errors were encountered: