开发者

MVC3 - Is there a proper name for this type of service pattern?

开发者 https://www.devze.com 2023-04-03 02:44 出处:网络
I am using Controllers as servicesto return HTML/JSON.Is there a proper technical name for what I am doing here?

I am using Controllers as services to return HTML/JSON. Is there a proper technical name for what I am doing here?

  1. A user triggers an event
  2. Perform AJAX GET
  3. Request handled by Controller
  4. Return HTML/JSON
  5. Populate front end HTML object(s) with result

This strikes me as a service oriented design. It has the开发者_高级运维 benefit of behaving like a RIA app. I have heard of "RESTFUL" services, but I don't know if this fits the bill.


I use the exact same schema in our main app. It's a subset of Service Oriented Design/Architecture. You actually use "services", such as: Login, CreateBlogPost, DeletePicture, Register, Connect and so on. But I believe that services serve broader goals. For example, exposing an API, which could be essentially accessed in the same manner you describe but respond to more HTTP verbs other than GET: POST, HEAD, PUT, DELETE. This is a RESTful service, as you mentioned.

So, to answer your question, the schema you describe plays a role in a good architected RIA. I don't believe it has a unique name of its own (besides being part of SOA).

0

精彩评论

暂无评论...
验证码 换一张
取 消