Hacker News new | ask | show | jobs
by lifeisstillgood 5439 days ago
I am concerned by the tendancy to throw everything into one in-process model. (by in-process I mean that we are calling a ruby function calculatePrice in the same model / whatever instead of calling out to a web api and getting back a price)   

It's usually cleaner to think about web service calls - not  put everything into same model

even though you can cleanly seperate functions within a single model the tendancy to make an inprocess call not an api call is always high.    So removethe tempation.

Have a thin model, a thin view and a thin controller all doing just one (rest-ful) thing and call between them

the overhead in creating objects from passed in Json is far lower the trying to unstitch logins, transactions, funny bits of business logic from one monolithic model 

(not that I am saying you would end up with a monolithic piece of spagetti but I have seen some indark corners of the enterprise world, even in projects which have all the right buzzwords)

1 comments

I struggled to comprehend what you are trying to say.

It sounds like you're saying "Make everything a service and that will solve all your problems". But in doing so, you abstract the complexity from the core of the problem, to some other layer. Sort of like SOA, meaning you end up with some orchestration language (BPEL?). You've ended up with a kitchen full of self-replicating spaghetti.