So I am fairly new to OOP and I've been trying to start Unit Testing my apps in whatever language. But I realized that testing requires a certain approach to designing your Classes with less dependencies. From what I've read I've come to conclusion that the thinner the class the better since responsibilities are delegated to other classes, the approach I am practicing right now.
So I've been playing with Typescript and wanted to create simple Money management app. By coding it what I wanted to learn is if the way I have designed these classes enable better design and testability overall. For example I have an Amount object with a function that accepts an object of type Money and returns its amount property.
Does it make dependencies less loose? Does this kind of approach even make sense to be implemented? (Hoping to hear different opinions from gurus of OOP. Constructive criticism is welcome!)
A paste bin with all the classes
Aucun commentaire:
Enregistrer un commentaire