365 Days of code: Week 2

Introduction

As with any system adopting the continual improvement paradigm, I have decided to make some changes to blog post frequency. I will be coding pretty much everyday but blog only weekly, summarizing only the most interesting things I implemented over the last week. This will help to maximize the time spent in writing code and also improve quality of posts.

Extending the Fitrupt API

So I will be continuing on the previous spring boot project and extending it to a minimal viable product that uses CRUD operation.

The Design

Before starting to write code, it is essential that we design the application model, using something like an UML diagram. This helps us keep the code organized, and visualize the high level functionality of the entire application.

Data Model

We start with the model first. Spring is a contract-first framework, which means development is based on the request and response. So we will design few services that will do few things like:

  • Receive user’s name, age, email, gender etc.
  • perform calculations like BMI, FFMI, TDEE etc.
  • store the user details in a subscriber’s database.

Changes

Last time I faced an issue with implementing enums. This time I have updated the code with properly working enums for gender and activity levels.

Another practice that I will be using from now on is TDD. I will write unit tests to define the expected output and then update the application so that the test passes.

Code

Leave Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll Up