Timeline for Should you always pass the bare minimum data needed into a function in cases like this
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 13, 2014 at 20:59 | comment | added | Piotr Perak | @jk.: if it's hard to build User then something is wrong | |
May 13, 2014 at 20:57 | comment | added | Piotr Perak | @JohnLBevan: YAGNI!!! | |
May 12, 2014 at 14:09 | comment | added | jk. | @Peri a real User class might be complex to create, taking an interface allows you to mock it out so you can keep your tests simple | |
May 11, 2014 at 19:27 | comment | added | JohnLBevan | It adds future flexibility for very little effort, so whilst not adding value currently it doesn't hurt. Personally I prefer to always do this since it avoids having to think through future possibilities for all scenarios (which is pretty much impossible given the unpredictable nature of requirements, and will take a lot more time to even get a partially good answer than it would to stick in an interface). | |
Nov 7, 2013 at 22:11 | comment | added | Piotr Perak | IUser is useless here and only adds complexity. I don't see why you couldn't use real User in tests. | |
Nov 3, 2013 at 22:12 | review | First posts | |||
Nov 3, 2013 at 22:51 | |||||
Nov 3, 2013 at 21:55 | history | answered | JohnLBevan | CC BY-SA 3.0 |