RESTful Web Services


1. The Fundamental
 
   1.1 What’s REST 
            REST: REpresentational State Transfer 
            It’s an architecture style (the stateless client-server architecture), not a toolkit. 
   1.2 REST defined 
            ●Resources are identified by uniform resource identifiers (URIs) 
            ● Resources are manipulated through their representations 
            ●Messages are self-descriptive and stateless 
            ●Multiple representations are accepted or sent 
            ●Hypertext is the engine of application state 
   1.3 Representation 
            Just think that a web page is a representationof a resource, and the customer can get the resource from the URLs. Clients can then request a specific representation of the concept from the representations the server makes available. 
   1.4 State 
         “State” means application/session state, maintained as part of the content transferred from client to server back to client.Application state is the information necessary to understand the context of an interaction.The "stateless" constraint means that all messages must include all application state. 
     1.5 Transfer of state 
         ●Connectors (client, server, cache, resolver, and tunnel) are unrelated to sessions 
         ●State is maintained by being transferred from clients to servers and back to clients

The Conclusion: 
         So we can say that “REST is a post hocdescription of the Web”. Unsurprisingly, HTTP is the most RESTful protocol. 

    1.6 REST messages 
           REST can support any media type, but XML is expected to be the most popular transport for structured information, it can make a resource have as many representations as you need,The XmlHttpRequest object lets you do REST from insidea web page.Unlike SOAP and XML-RPC, REST does not really require a new message format; it’s just use URLs to transfer the messages as parameters. 
   1.7 Web based application 
          A Web-based application is a dynamically changing graph of 
         – State representations (pages) 
         – Potential transitions (links) between states 
   1.8 OOP on REST 
          Every useful data object has an address;Resources themselves are the targets for method calls; the list of methods is fixed for all resources. 
   1.9 REST and RPC 
            ●REST is, in a sense, a species of RPC, except the methods have been defined in advance. REST is incompatible with "end-point" RPC. So REST is architecture not only a design style. 
            ●Most RPC applications don't adhere to the REST philosophy. 
            ●It’s possible to work with RPC-style tools to produce REST results. 
   1.10 POST on the REST attitude 
          There are two views on POST, the first is “POST lets you pass a whole lot of parameters and get something back, bypassing caches.”, and the other is “POST lets you create new resources that are related to old ones.” The second view is on the REST point.
 
2. RESTful Web Services 
         In the web services world, REpresentational State Transfer (REST) is a key design idiom that embraces a stateless client-server architecture in which the web services are viewed as resources and can be identified by their URLs. The Java API for XML Web Services (JAX-WS) provides full support for building and deploying RESTful web services. 
   2.1 When to use REST 
            ● The web services are completely stateless. 
            ●A caching infrastructure can be leveraged for performance. 
            ●The service producer and service consumer have a mutual understanding of the context and content being passed along. 
            ●Bandwidth is particularly important and needs to be limited. 
            ●Web service delivery or aggregation into existing web sites can be enabled easily with a RESTful style.
2.2 How to build a RESTful Web Service 
         JAX-WS enables building RESTful endpoints through a javax.xml.ws.Provider interface in the API. Provider is a generic interface that can be implemented by a class as a dynamic alternative to a service endpoint interface (SEI).
       The two important annotations in development:
       1. @WebServiceProvider (wsdl=”…….”)   //wsdl can omit
       2. @BindingType (value=HTTPBinding.HTTP_BINDING)   //Must
      
Reference:
  1. RESTful Web Services by
Sameer Tyagi: 
            http://java.sun.com/developer/technicalArticles/WebServices/restful/ 
  2. Publishing a RESTful Web Service with JAX-WS by Doug Kohlert:                     
          
http://weblogs.java.net/blog/kohlert/archive/2006/01/publishing_a_re.html
 3. Make Your Service RESTFul by Robin Zou: 
          http://zouzhile.googlepages.com/basicrestful

内容概要:本文详细介绍了如何利用Simulink进行自动代码生成,在STM32平台上实现带57次谐波抑制功能的霍尔场定向控制(FOC)。首先,文章讲解了所需的软件环境准备,包括MATLAB/Simulink及其硬件支持包的安装。接着,阐述了构建永磁同步电机(PMSM)霍尔FOC控制模型的具体步骤,涵盖电机模型、坐标变换模块(如Clark和Park变换)、PI调节器、SVPWM模块以及用于抑制特定谐波的陷波器的设计。随后,描述了硬件目标配置、代码生成过程中的注意事项,以及生成后的C代码结构。此外,还讨论了霍尔传感器的位置估算、谐波补偿器的实现细节、ADC配置技巧、PWM死区时间和换相逻辑的优化。最后,分享了一些实用的工程集成经验,并推荐了几篇有助于深入了解相关技术和优化控制效果的研究论文。 适合人群:从事电机控制系统开发的技术人员,尤其是那些希望掌握基于Simulink的自动代码生成技术,以提高开发效率和控制精度的专业人士。 使用场景及目标:适用于需要精确控制永磁同步电机的应用场合,特别是在面对高次谐波干扰导致的电流波形失真问题时。通过采用文中提供的解决方案,可以显著改善系统的稳定性和性能,降低噪声水平,提升用户体验。 其他说明:文中不仅提供了详细的理论解释和技术指导,还包括了许多实践经验教训,如霍尔传感器处理、谐波抑制策略的选择、代码生成配置等方面的实际案例。这对于初学者来说是非常宝贵的参考资料。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值