qossmic / deptrac

Keep your architecture clean.
https://qossmic.github.io/deptrac
MIT License
2.61k stars 135 forks source link

Can you explain how to do X with Deptrac? (Deptrac is starting a blog) #1184

Open patrickkusebauch opened 1 year ago

patrickkusebauch commented 1 year ago

Deptrac is starting a blog on its official documentation site. As a part of it, I am collecting ideas for topic people would like to hear about. Feel free to add your ideas as comments in this issue. I will kick off the process by writing some that I have observed:

patrickkusebauch commented 1 year ago

How to prohibit an instantiation of a class (from Slack):

Hi folks, I want to restrict the usage of a given class: allow referencing (eg. usage in "use" statements or arguments) but not its instantiation (calling constructor). So I tried to create a custom rule but the official documentation (https://github.com/qossmic/deptrac/blob/main/docs/extending_deptrac.md) is very succinct and doesn't provide useful examples. Do you have some additional documentation or code examples?

patrickkusebauch commented 6 months ago

Explain how to create layers where token cannon reference other tokens from the same layer: https://github.com/qossmic/deptrac/issues/1278

gennadigennadigennadi commented 2 months ago

https://qossmic.github.io/deptrac/blog/2023-05-11_PHP_configuration/ FYI: @patrickkusebauch

jorgsowa commented 2 months ago

how to handle complex architectures like DDD which require handling different "levels" of layers (different ways of slicing the classes and defining the dependency rules). Since classes cannot belong to multiple layers, the only solution I found was to use separate configuration files but it might be a better solution (From Slack)

I'm awaiting this topic. It's not straightforward how to define modules with interfaces/contracts without marking all the files with a @internal comment.