Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not so sure that's a good idea. A component is one possible interface to the business logic, but there isn't necessarily a 1:1 mapping.

Colocating data logic together makes it easier to build a data model that is logical and consistent, rather than one that is coupled to UI decisions.



It's not a black and white thing, you can have a feature structure for your UI and services, and one folder with just the data models.

Sometimes your frameworks kinda force it on you too.


Wow. Came here to make this comment. It seems like the whole point of a model layer is to decouple it from the UI and the Controllers.




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

Search: