面向服务的计算期末复习笔记

这门课程所使用的教材是 Jia Zhang 老师自己编写的 Services Computing,课程内容其实相对老旧,不过我之前没有 Java 方面的经验,这门课还是让我学到了很多。

Week 1

  1. Generations of Software Engineering:
    • 1st: Waterfall, compiler, OS, programming language;
    • 2nd: Stuffs we learned in FSE (OOAD, patterns, modeling…);
    • 3rd: SOC, platform is the key.
  2. Service operational models:
    • Hosted service model;
    • Business process outsourcing;
    • Data-center outsourcing;
    • Services through online broker agency.
  3. Service charge models:
    • Free-of-charge models;
    • Fee-based models;
    • Government service models.
  4. Service Level Agreement (SLA): Pay more for better service. Can support large user base and usage scenarios.
  5. A service-oriented system is modeled as a feedback system.
  6. Service lifecycle:
    • Consulting & strategic plan;
    • Service engagement;
    • Service delivery;
    • Service operation;
    • Billing.
  7. Vertical services: Service industries (banking, telecom, …); Horizontal services: Commom services (Business services: CRM, …, has business logic, supports multiple scenarios; IT services: database, OS).
  8. SOC is a discipline (umbrella); SOA is a architectural model (overall software system design); Web service is the best enabling technology.
  9. Typical service system: <Inputs, Outputs, Goals, Transformation, Components, Sensors>.
  10. IT-enabled service: Outsourcing of processes that can be enabled with information technology and covers diverse areas; It’s about relationship between providers and consumers.

Week 2

  1. HTML and XML are both based on SGML (Standard Generalized Markup Language).
  2. XML tags are case-sensitive.
  3. <![CDATA[This is a comment]]>.
  4. Each XML document must have a unique first element: the root node.
  5. DTD serves as the grammar for underlying XML document. Example:
<!DOCTYPE db[
    <!ELEMENT db(person*)>
    <!ELEMENT person(name, age, email)>
    <!ELEMENT name(#PCDATA)>
    <!ELEMENT age(#PCDATA)>
    <!ELEMENT email(#PCDATA)>
]>
  1. XML Schema: Grammar for specifying valid XML documents. It is XML itself, so it’s verbose. Example:
<xs:element name="note">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="to" type="xs:string" />
            <xs:element name="from" type="xs:string" />
            <xs:element name="heading" type="xs:string" />
            <xs:element name="body" type="xs:string" />
        </xs:sequence>
    </xs:complexType>
</xs:element>
  1. DTD vs. XML Schema:
    • DTD (Old): Learning curve but terse;
    • XML Schema: Verbose but powerful (extensible, data types, namespaces).
  2. XML parsing:
    • DOM (Document Object Model): Load whole XML document in memory: Faster;
    • SAX (Simple API for XML Parsing): Supports larger files.
  3. XPath examples:

  4. XQuery: For, Let, Where, Order by, Return (FLWOR). Example:
for $x in doc("book.xml")/bookstore/book
where $x/price > 30
order by $x/title
return $x/title
  1. Other information:
    • JSON also has JSON Schema for validation;
    • Same Origin Policy (SOP): Full access to same origin (network, documents, storage, cookies);
    • XSLT (Extensible Stylesheet Language Transformations) is a language for transforming XML documents into other documents;
    • XML data binding refers to the process of representing the information in an XML document as an object in computer memory.

Week 3

  1. REST (Representational State Transfer) is a server-side technique; AJAX is a web technique which can only retrieve data from the server side. AJAX can be part of REST but REST can never be AJAX.
  2. HTTP (Hypertext Transfer Protocol).
  3. Mashup:
    • Pros: lightweight app, lightweight & rapid development, low cost for gathering data;
    • Cons: Dependency, versioning, copyright, security.
    • Component discovery & selection -> Composition & immediate deployment -> Use and evolution -> … (loop).

Week 4

  1. WSDL (Web Service Description Language). WSDL 1.1 example:
<message name="getPriceRequest">
    <part name="productId" type="xs:string" />
</message>

<message name="getPriceResponse">
    <part name="value" type="xs:string" />
</message>

<portType name="productPrice">
    <operation>
        <input message="getPriceRequest" />
        <output message="getPriceResponse" />
    </operation>
</portType>
  1. SOAP (Single Object Access Protocol) acts as the messaging protocol binding to HTTP and SMTP:
    • WSDL binding to SOAP: In WSDL, you will need to specify binding with SOAP, then you can write SOAP message to communicate with the service.
  2. BPEL (Business Process Execution Language):
    • WSDL / REST supports a stateless model; While a business process (BP) is characterized by long-running, stateful sequence of operations;
    • Business process orchestration;
    • BPEL also has <throw> and <catch>;
    • Example:
  3. WSRF (Web Services Resource Framework) is stateful.
  4. WS-I (Web Services Interoperability) organization is to tackle the challenges of interoperability among web services by introducing conventions and best practices.

Week 5

  1. A web service can be published in a centralized services registry or a distributed services registry:
    • UDDI (Universal Description Discovery and Integration) registry is one typical example of centralized ~:
      • Four elements: BusinessEntity, BusinessService, BindingTemplate, tModel.
      • WSDL and UDDI:
      • UDDI Search Markup Language (USML) for supporting “Google” style services Search.
    • WSIL (Web Services Inspection Language) is one example of publishing web services as distributed documents. Example:
    • Advanced UDDI Search Engine (AUSE); Dynamic Service Discovery Framework (DSDF);
    • The federated framework provides a uniform interface for both UDDI-based and WSIL-based service discovery.

Week 7

  1. LDA (Latent Dirichlet Allocation): Using Gibbs Sampling to calculate the result.

Week 10

  1. MetaWSDL is a superset of WSDL:
    • It should be published to the Internet associated with the original WSDL documents.
  2. ESB (Enterprise Service Bus) consists of 4 components: mediators, services registry, choreographer, rule engine. ESB can do:
    • Routing;
    • Message transformation: XML to object),
    • Message enhancement: Supply data included in original data;
    • Protocol transformation;
    • Service mapping;
    • Message processing;
    • Process choreography: Co-ordination of multiple business services, usually BPEL-based;
    • Services orchestration: Co-ordination of multiple implement services, usually BPEL-based;
    • Transaction management;
    • Security.
  3. SOA Reference Architecture (SOA-RA) partitions an SOA-based system into reusable achitecture components.
  4. Service-Oriented Modeling and Architecture (SOMA) guides a generic engineering process. It identifies 3 steps: identification, specification, realization.
  5. Different layers of web service standards:
    • Transport Layer: HTTP / HTTPS, SMTP (Simple Mail Transport Protocol, on port 25), RMI (Java Remote Method Invocation) / IIOP (Internet Inter-ORB Protocol), JMS (Java Message Service);
    • Messaging Layer: XML, SOAP, WS-Adressing, WS-Renewable;
    • Description / Publishing / Discovery Layer: XSD (XML Schema Definition), WSDL, WSRF (WS-Resource Framework), WS-Resource Properties (part of WSRF), UDDI, Others (WS-Based Faults, WS-Policy, WS-Metadata Exchange);
    • QoS (Quality of Service Layer): WS-Security, WS-Policy, WS-TM (WS-Transaction Management), WS-Reliable Messaging, WS-Resource Lifetime;
    • Service Composition Layer: SOAP + WSDL + UDDI, BPEL4WS, WS-Service Group, WS-Notification
  6. Industry-specific service-oriented standards:
    • Electronic Industry: RosettaNet.

Week 11

  1. BPOL (Business Process Outsourcing Language).
  2. SGA (Simple Genetic Algorithm) steps:
    • Select parents from population;
    • Shuffle mating pool;
    • For each pair, apply crossover with probability pc;
    • For each offspring, apply mutation with probability pm for each bit;
    • Replace old population with new offsprings.
  3. Mutation-only-EA is possible, xover-only-EA won’t work.

Week 12

🍺

Week 13

  1. RDF (Resource Description Framework):
    • It also has RDFS (RDF Schema): XMLS (XML Schema) is not an ontology language, while RDFS is an ontology language;
    • It is graphical formalism;
    • It supports containers: Bag, Seq, Alt.
  2. In graph database, we have: Subject –Predicate–> Object; In RDF statement, we have: Resource –Property–>Value.
  3. Relational Database has tables with pre-defined schema, while RDF has knowledge without constraints.
  4. SPARQL (SPARQL Protocol and RDF Query Language):
    • SELECT, ASK (return a boolean), DESCRIBE, CONSTRUCT;
    • FILTER, DISTINCT, ORDER BY, LIMIT, OFFSET;
    • UNION (like “or”), OPTIONAL;
    • FROM, FROM NAMED.
  5. Turtle (Terse RDF Triple Language). Turtle and SPARQL example:

Week 14

  1. A more complex example of RDF:
  2. OWL (Web Ontology Language); OWL-S (Semantic Markup for Web Service).
  3. WSMF (Web Service Modeling Framework).

Week 15

  1. A microservices architecture puts each element of functionality into a separate service. Modules run in different processes.

Key Information

Web Service Standard Stack
  1. Transport layer: Provides core communication and interactions for web services.
    • HTTP / HTTPS: Runs on 80 / 443; Over TCP; Request / response protocol to transfer information over the Internet;
    • SMTP: Runs on 25; Simple Mail Transfer Protocol; Text-based protocol to send mail over the Internet;
    • RMI / IIOP: Java Romote Method Invocation to create distributed Java-based app; Internet Inter-ORB Protocol is a tranport protocol for communication under CORBA;
    • JMS (Java Message Service): A standard for reliable enterprise messaging.
  2. Messaging layer: Appropriately formats messages for exchanging information between web services.
    • XML: “Common language” for services to exchange information;
    • SOAP: A simple, lightweight protocol to exchange structured and typed information;
    • WS-Adressing: Identifies WS endpoints, and to secure end-to-end identifications in messages;
    • WS-Renewable: provides a mechanism for renewing reference to web resource.
  3. Description / Publishing / Discovery layer: No need to explain.
    • XSD: XML Schema Definition, no need to explain;
    • WSDL: No need to explain;
    • WS-Resource Property: Part of WSRF, describes how to view and modify web resourse;
    • UDDI: No need to explain;
    • WS-Base Faults: Defines an XML Schema type for base faults, and how they can be extended;
    • WS-Policy: Describe capabilities, requirements and general characteristics of a WS;
    • WS-Metadata Exchange: Facilitate the retrieval of metadata from WS.
  4. QoS layer: Addresses the NFR of WS.
    • WS-Security: A set of mechanisms to secure SOAP message exchange;
    • WS-TM: “TM” for “Transaction Model”, protocols for managing transaction features in business activities;
    • WS-Resource Lifetime: To inspect and moniter the lifetime of WS and how WS can be destroyed;
  5. Service Composition Layer: Allows developers to compose services together for a common business goal.
    • BPEL4WS: No need to explain;
    • WS-Service Group: A wide variety of collections of web services or WS-Resources;
    • WS-Notification: A set of specifications that provide support for events.
评论