Eh you could. Personal preference.
Easier mocking with tests. Also allows you to mutate the value before returning in the getter. You could do that with a property, but feels better in a function, in my opinion
v
Vampire
03/11/2021, 4:13 PM
You can easily have a custom getter for the property and do any mutation you want.
I usually do it like this: "does it return you some value for the class and not take a parameter => property" if it needs parameters or the returned value is just a side-effect or status value and the main purpose for the "thing" is to do something, then method. 🙂
👍 1
u
ursus
03/12/2021, 2:47 AM
properties are annoying on Daos since they often have parameters, and I dont like mixing props and funcs
fooDao.findById() etc .. so .. find? 🐤 lol