Hacker News new | past | comments | ask | show | jobs | submit login

> Why create a separate type over this class which is just a projection of its data?

Because it lets you refactor your API separately from your domain. And use the full power of the IDE/typechecker in both cases.

This approach especially shines with JAX-RS; you can write fully typed tests against your API methods, which look like pure logic functions.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: