Separating client side logic from server side logic in a reusable way using MVC

Before you answer, this question is complicated: 1. We are developing in / mvc / jQuery but I'm open to solutions on any platform using any framework 2. I think logic like sorting / hiding columns / re-arranging columns / validation (where it makes sense) should be on the client-side 3. I think logic like searching / updating the db / running workflows should be on the server side (just because of security / debugging reasons) What we are trying to do is **NOT CREATE A MESS** in our UI by writing a bunch of JavaScript to deal with the same feature in different contexts. I understand that I can use a JavaScript file + object oriented JavaScript, I'm looking for the pattern that makes it all easier. One solution proposed was to have an MVC model on both the client and server side, where we can encapsulate JavaScript functionality in client side controllers, then use them in different parts of the site. However, this means that we have 2 MVC implementations! Is this overkill? How would you expand on this solution? What other solutions are there?

以上就是Separating client side logic from server side logic in a reusable way using MVC的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准