Refactor: improve code structure and maintainability#21
Conversation
|
clang-tidy review says "All clean, LGTM! 👍" |
… with a virtual dispatch by extracting interface;
… BioDynaMo directory project-structure
ecd14bb to
ed7eafe
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
ed7eafe to
b1534ab
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
b1534ab to
b7eadbf
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
b7eadbf to
86958ad
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
86958ad to
5898acd
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Hi @salva24 , @vgvassilev |
|
clang-tidy review says "All clean, LGTM! 👍" |
55cfe1f to
aa5f856
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Hi, could you please include a small explanation in the readme for the new interface you created substance_interactor.h ? :)
There was a problem hiding this comment.
Done. Thanks for the heads up! :)
There was a problem hiding this comment.
Great job, thank you very much for your contribution! :)
There was a problem hiding this comment.
Thank you to you too! I appreciate the feedback! 🙌
|
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Great job, thank you very much for your contribution! :)
Changes
ComputeConsumptionsSecretionsmethod inDiffusionThomasAlgorithmpreviously used a chain of dynamic_cast calls to handle TumorCell and CarTCell agents separately. This meant that adding any new cell type would require modifying the diffusion grid code directly. As it also was noted with a fixme comment I created a new interfaceISubstanceInteractor (declared in src/interfaces/substance_interactor.h)Both TumorCell and CarTCell inherit from it.The diffusion grid now performs a single cast to the interface, with no knowledge of concrete cell types, thus respecting the open/closed principle;
src/
├── agents/
├── diffusion/
├── forces/
├── interfaces/
├── params/
├── utils/
├── cart_tumor.h
└── cart_tumor.cc
Related
DiffusionThomasAlgorithm::ComputeConsumptionsSecretions