gacela-project / gacela

Build modular PHP applications.
http://gacela-project.com/
Other
131 stars 7 forks source link

Adding cache for DocBlockResolverAwareTrait #163

Closed Chemaclass closed 2 years ago

Chemaclass commented 2 years ago

There is only one place where Gacela is using reflection: DocBlockResolverAwareTrait, and this is a very special trait that could be used in your infrastructure layer to get the facades of your modules, for example.

The thing is that nothing stops the user to use this trait whenever they want. Anyway, the goal is to build a file cache mechanism to avoid using reflection on "production" code.

This issue is to give it another try this PR ➡️ https://github.com/gacela-project/gacela/pull/120 (We can use this idea to get some inspiration).

JesusValera commented 2 years ago

@Chemaclass can we close this issue?

Chemaclass commented 2 years ago

Actually... not yet. We created a cache system for the class resolver itself https://github.com/gacela-project/gacela/pull/165 but we are still using reflection for the DocBlockResolverAwareTrait. Now we need to think how could we create something similar (I don't know how yet) to have a cache as well for this trait in order to avoid using reflection every time... 🤔 I will think about this this week.

Chemaclass commented 2 years ago

Done: https://github.com/gacela-project/gacela/pull/168