VirtusLab / ddd-public-materials

All public materials for community prepared by The DDD guild from Virtuslab
5 stars 1 forks source link

Add Tempo VO exercise #36

Closed jakubiec closed 3 years ago

jakubiec commented 3 years ago

Add to task implement Tempo VO.

Description: "Let's play this tune a little bit faster" says conductor. "Like what?" asks drummer "10 BPM more" "Ok, so it gonna be 130BPM"

Have you ever though what indicates how fast the music is?

The tempo!

A tempo indicates how fast the piece of music as a whole should be played. It is expressed in beats per minute (bpm or BPM). [image of tempo]

A number of beats obviously can be a positive integer and its highly unlikely that it would be faster than 500BPM.

Hopefully, you have recognised that a Tempo seems to be a good candidate for the Value Object. Let's think about its properties...immutable, compared by properties, self-validating, cohesive - let's implement it.

Please take a look at the snippet and finish Tempo Value-Object implementation.