Understanding URLs, CSS Inheritance, and Web Technologies
1. Explain What a URL Is, Its Usefulness, Parts, and Defects
The URL (Uniform Resource Locator) is a subset of URIs. They are used to name resources for use. A URL is divided into three parts, which we see in this example:
Disadvantages: When you have multiple copies (replicas), different URLs offer no mechanism to refer to a page without specifying where it is simultaneously.
2. CSS Property Inheritance and Selector Application Rules
In CSS, the child inherits the style properties of the parent. For example, if you assign a font to the parent, the whole document will inherit this font. However, if a child has a different source, all its children will inherit from it.
Another example would be assigning the body italics, so that the whole document would be presented in italics. If one of its children is assigned red, that child and all its descendants will have both italics and red.
Rules apply:
- *: Applies to all elements
- E: All elements E
- E>F: Any F direct child element of E. Ex: F>E
- EF: Any F element descendant of E. Ex: F>A>E
- E + F: F element that follows E. Ex: E>F>
- E#X: E element whose id is X
- EY: E element whose class attribute is Y
- Pseudo-classes are added to selectors to indicate special properties, such as when a link has been visited or hovered over.
- Grouping Rules: Elements are grouped by “.” Ex: E, F, H
3. Operation of CGI
CGI (Common Gateway Interface) is a standard that allows a web client to request data from a program on a web server.
CGI was one of the first ways to create dynamic web pages, although today it is rarely used due to its high computational cost and complexity of generating HTML using traditional programming languages.
Basically, the operation of CGI is as follows:
- The client requests a URL from the server.
- The server runs the application, passing it background information such as the requested URL, the client IP, GET or POST data sent, etc.
- The output of the application is sent back to the client.
4. Types of Requests Used with CGI
CGI can perform both GET and POST requests. In the former, the server stores the parameters received in the QUERY_STRING environment variable, and the CGI program retrieves the name and value of the variables sent by the user.
For POST requests, the data received is placed in the standard input of the application for processing.
5. Passing Information to CGI Using the GET Method
When a GET request is made, the server stores the parameters received in the QUERY_STRING environment variable (name=value pairs), which the CGI program decodes and processes.
6. Conditions for Well-Formed XML Documents
xml version=”1.0″ encoding=”ISO-8859-1″? No “doctype”, a DTD
HTML title>
“nocaption” is not a valid attribute for this element
Element 1 li>
Element 2 li>
7. CSS Color and Font Settings in the Tree
BODY (color: Black; font: Times)
OL + LI (color: yellow)
LI (color: orange)
UL LI (font: Arial)
A (color: red)
LI>A (color: blue)
BODY (color: Black; font: Times)
| -> OL (color: Black; font: Times)
| |
| | -> LI (color: Orange; font: Times)
| | -> LI (color: Orange; font: Times)
| | -> P (color: Orange; font: Times)
| | -> A (color: red, source: Times)
| -> UL (color: Black; font: Times)
| -> LI (color: Yellow; font: Times)
| -> LI (color: Orange; font: Times)
| -> A (color: red, source: Times)
8. HTTP Headers and Cookie Transmission
- None
- Set-Cookie: a=”value”
- Cookie: a=”value”
- Set-Cookie: b=”valorB” max-age=7200
- Cookie: b=”valorB”
9. Operation of Web Services
Operation:
Web Services (WAS) function as remote procedure calls, but on the basic infrastructure of the Internet. The methods or functions that can be invoked with input parameters and output (WAS interface) are specified using WSDL. UDDI is a directory of WAS with corresponding WSDL descriptions.
Once we have the WSDL description of the function, it is called remotely (WAS) by exchanging SOAP messages in Markup Language (XML). You can use different protocols, but usually SOAP over HTTP.
The WAS server implements the service, processes the call, and returns a result with SOAP encapsulated XML.
The process is independent of programming language and platform.
Utility:
WAS exposes a business function with which other applications can interact via the web.
Advantages:
Allows the exchange of XML documents over HTTP, the exhibition of “services” via the web (Internet), interaction between applications (software) through the web, and facilitates interoperability between heterogeneous systems.
Uses standard Internet protocols for exchanging XML documents between processes. They act as a remote procedure call.
10. Idempotent Operations
An idempotent operation is one where the result does not depend on the number of times it is executed. Generally, any operation to obtain information may be considered idempotent, as it does not change the data value. Such operations should use GET requests.
In contrast, when transactions involve performing an action that changes the value of information, it is considered a non-idempotent operation, and the method used to undertake it must be POST. An example of a non-idempotent operation is an online purchase or user registration on a website.
11. Serialization and Deserialization in LPR
The serialization and deserialization processes consist of storing the data exchanged by LPR, making it suitable for transmission so that both ends of the communication can understand and process it.
The work of serialization and deserialization is necessary in a LPR since the ends may be different platforms and therefore may use different ways to store objects and data values. Through both processes, it ensures that the data received by the receiver is the same as that sent by the sender.
12. CORBA Architecture
CORBA is a platform that enables operations on remote objects.
It consists of:
- An interface definition language (IDL) that defines the processes and methods available through remote invocation.
- An interface compiler that generates source code for use in client and server programs.
- The so-called ORB (Object Request Broker), which is responsible for communication between client and server.
- References ROR, which uniquely identify an object.
When performing a remote method call, it is first necessary to know its reference ROR. Once known, the client, through Stub code, serializes the data and sends it through the ORB to the remote server. The server is then responsible for deserializing the data and invoking the requested method on the object reference specified in the ROR.
13. ROR in CORBA Terminology
ROR stands for Remote Object Reference. Each object has a unique ROR, which is generated in the Object Adapter. The ROR allows the ORB to locate the remote computer and the adapter object where it is located.
The ROR can be obtained:
- Through special services of CORBA.
- From an IOR string mode:
- From a file: NFS
- Through an object download protocol: HTTP, FTP, OBEX, etc.
14. Cost Analysis of CDN vs. Mirroring System
Recommendation: Calculate for Both Alternatives and Compare the Daily Price
By CRC:
Cost per day:
Conclusion:
The best alternative is the use of mirrors, as it is the cheapest option.
Questionnaire 2
2. Proactive Caching Mechanism
A proactive caching mechanism allows the proxy to inspect and pre-load into cache pages linked to hyperlinks when it retrieves a website. This reduces access time but can also flood the proxy with unusable material. It is a more complex mechanism.
3. Content Delivery Network (CDN)
A Content Delivery Network (CDN) is a system where content providers contract with the CDN for the delivery of web content: images, software, MP3s, videos, etc. The CDN then contracts with thousands of ISPs to allow them to place their content on their LAN, on a server controlled remotely by the CDN.
Advantages:
There is no need to change anything on the servers, DNS, or other elements of the protocol.
4. Sending Information from Client to Server Using HTTP
The HTTP protocol operates at the application level over TCP. First, TCP communication is established, then the necessary messages are exchanged between the client and server using HTTP, and once the query is made, the connection is closed.
Each client request is an ASCII string (7 bit), where the first word (in CAPS) indicates the operation to perform. It is sent to the server via a TCP connection. Example:
GET /directory/paginaweb.html HTTP/1.0
The server responds with:
Online Status (Code + Code Information)
Additional headers
+
Blank line (MANDATORY)
+
MIME object response
The HTML code must appear at least on the client side as the label and
.
5. Appropriate Use of GET and POST Methods
GET operations should be used for idempotent operations, i.e., operations that do not depend on the number of times they run. Typically, transactions that involve obtaining data are idempotent. GET does not allow the sending of large amounts of data or binary information.
In addition, the POST method is preferable for operations that alter the value of information, such as updating a profile or registering a user. However, POST can often break the functionality of the back button and reload the browser.
7. Database and Database Software
A database is a set of data stored systematically for later use.
Database software is the system that manages how to view and access data stored in a database.
Queries with databases are performed using a standard language called SQL. This language allows selecting rows and cells of the database (getting data) as well as managing tables, columns, permissions, indexes, etc.
10. Operation of AJAX
AJAX (Asynchronous JavaScript and XML) is a set of technologies (JavaScript, XML, HTTP, etc.) that allows communication with the server asynchronously (unlike HTTP, which performs the query synchronously), enabling the client to continue using the page while the request is made. This enhances interactivity, speed, and usability of web applications.
11. Communication Between Processes
Communication between processes involves techniques to exchange information (messages) between processes (locally or remotely). The characteristics of communication between processes include synchronous or asynchronous communication, message destinations (IP address, port), and reliability and management.
The mechanisms that can be used to implement this include:
- Socket interface: Intercommunicating abstracted tasks between processes. Socket() creates a socket and returns a descriptor of the connection.
- Remote Procedure Call (RPC): Invocation of operations in various processes on the same or different machines. An object instantiated in a process invokes a method on an instantiated object in another process (local or remote). The RMI layer allows these operations to be transparent to the programmer.
13. Differences and Similarities Between Web Services and CORBA
Web Services technology is a remote procedure call based on standard Internet protocols like HTTP and XML. In contrast, CORBA technology is also a remote procedure call but operates at the level of objects rather than simple functions and uses its own protocols, such as IDL, ORB, or ROR.
14. SOAP and Its Context
SOAP is a protocol for exchanging messages. It is used in web services to transport XML documents via the web. It can also be used with the HTTP POST command (though it can be used with other protocols such as HTTPS). It has three elements:
- SOAP Envelope: Root element
- SOAP Header: Header (optional)
- SOAP Body: Message body
15. Example of XML Document with Namespaces
This is a paragraph from the book