Approach at diet module, and important conclusions

Based on the earlier discussion, and my knowledge I’ve started implementing the diet module. So far It’s not enough code to write about. What is more important I’ve found out that my current implementation of patient module is rather procedural than objective. My mistake was to treat almost everything as data structure than living objects. Now It’s refactoring time!
Most of the time I’ve spent including symfony in the project. I could postpone decision about choosing framework – It’ll be used for the user interface layer and probably some of the infrastructure layer. But I’ve just wanted to play with symfony 3. Maybe later I’ll switch to another framework to show how easy it is if you write framework independent code.

I’ve also spent a lot of time thinking about the domain and how it should be represented. I had most concerns about BodyData class:

As you can see It has a lot of fields, one depend on another, but all this data are optional. I’ll move BMR and TMR to another class, so it will only exist if we have necessary data. Also it will make it possible for nutritionists to enter this data manually.

Leave a Reply

Your email address will not be published. Required fields are marked *