Full-end Web development using JavaScript and Java reading notes there are only two major challenges in the field of computer science: Cache invalidation and naming. REST (representational state Transfer) technology, he suggests a style of messaging for Web services.
Chapter One: Change as a result of changeEntrepreneurs are always looking for change, adapting to change and treating it as an opportunity. The Java EE and JSP have been perfected into Jee and JSF. In a modern client-server architecture, the server is more responsible for the client's requests, providing access to the resources (typically using XML and JSON to exchange information). In the past server-driven model, the page (and the data associated with it) was generated on the server side and returned to the client to render in the browser. In the client-server architecture, the server first returns an initial page with a small amount of data. When the user interacts with the page, the page initiates an asynchronous request to the server, and the server returns the message so that the page refreshes to respond to these events. Java Server Faces (JSF) is an XML-based template system and component framework, the navigation implementation of centralized configuration;! Google Web Tookit is another component of the framework, he played the Java program Ape's strengths, focus on writing Java, without concern html/css/and JS browser Innovation also contributed to the responsibility from the server want to transfer to the client. Microsoft has developed Ajax (asynchronous Javascript and XML) for pages that communicate with various web pages and servers. But the nature of the web has not changed (or the client-server architecture based on HTTP messaging) The advantages of C-s Web applications 1. Decoupling from the code logic enhances the cohesion of the original structure and subsequent support systems. Tiering the client and server side allows the code to become manageable and modular. In addition, data and display markers can be separated more clearly. You can publish data using JSON instead of inline. 2. "Design Flexibility" and "using Open Source API" 3. Prototype 4. Developer efficiency: Work is easier to divide, and the only limitation is that the original interface remains available. 5. Application performance: The perception of the page has a greater impact on the user's experience. The faster JS engine allows the client to perform computationally intensive operations to transfer the server's stress load to the client. Ajax technology can request less data on demand, which avoids frequent refreshes of the entire page.
Chapter II: JS and JS ToolsThe core JS language needs to be understood in conjunction with two different APIs: the browser object Model (BOM) and the Document Object Model (DOM) JS are directly affected by Perl: "More than one way to do something" has been greatly influenced by the schema. JS can define other functions in the function, the intrinsic function can access the variables of the external function. When a function returns an intrinsic function, a closure is formed. The returned object now contains the function itself, as well as the environment in which it was created: function outer () {var val = "I AM in outer space"; function inner () {return val; } return inner;}
var alien = outer (); Console.log (Alien ());
Chapter III: Rest and JSONRest is an architectural style that consists of a series of constraints that describe how the Web should work. What is the rest representational state transfer (REST) architecture is designed to model how modern web work is developed. Resources: Rest uses a web address (URI) to access resources and use verbs (HTTP requests) to manipulate resources. Verb: An HTTP request defines a set of verbs that represent the behavior of a resource. Uniform Resource Identifiers: can be further divided into: Uniform Resource Name (URN) and Uniform Resource Locator (URL) rest constraint: 1. Client-server Side 2. Stateless: Rest requires a stateless design, session data is saved on client 3. Cacheable, stateless performance issues can be compensated by caching. Rest requires that the data be labeled to indicate whether it can be cached. 4. Unified Interface 5. tiering 6. On-Demand delivery code
JSON: (JavaScript object Notation) JSON has advantages over XML: the corresponding body is smaller and the JSON is more interoperable with the web. JSON is a subset of JS, which makes client integration simple. Calling Ajax makes it easy. Cons: JSON is not entirely legal. Comments cannot be added in JSON. The eval () method is dangerous. Hateoas:json is a very simple and compact format. Unlike other systems that provide complex types for representing data, JSON provides only a limited number of data types. There are no types in JSON that represent hyperlinks, especially that rest contains a hypermedia as the application state engine (hypermedia as of the engine of application State,hateoas)
Fourth Chapter: Java ToolsMAVEN forces programmers to follow standards and specifications, saving resources and allowing flexibility to exist in large teams. MAVEN is "just a profound person" in the Jewish language, which is used to organize projects and define software development processes (Tools for software project management and understanding), simplifying the build process and providing a unified system (by declaring project dependencies) that is more than creating a project. His reporting and documentation functions are responsible for the production and centralized management of all project-related technical outputs.
Fifth Chapter: Client FrameworkStart 1: Responsive Web Design (responsive)-fluid grid (Fluid grid)-Elastic picture (flexible image)-css Media query (CSS media Query) Start 2:JS Library and framework download from GitHub
Sixth chapter: Java WEB API ServerPackaging reusable components makes it possible to extend the capabilities of the programming language. For a particular language, packaging affects how it is deployed. Packaging requires consideration of standard naming conventions, metadata files, digital signatures, code obfuscation, code management, including related files/resources, and compression mechanisms. Packaging can affect your deployment. A language provides a deployment option that allows you to control the structure and development process of a project, especially in Java. The name in the Java source file reflects the name of the public class it contains, and the package structure of Java follows the directory structure of the file system. Java uses several different types of package formats. Generic code is packaged into Java archive files (jars), Web application files are packaged into a Web application archive (WAR), and a set of related Web applications are packaged into an enterprise application archive (EAR). The war can be deployed in the OH servlet container, and the ear needs full enterprise Java support, and it must have an application server like JBoss. Java-based server: 1:java HTTP server 2:jetty embedded server 3:restlet4:roo5:netty embedded Server 6:play Server JVM-based server Jython If Python is already installed, is to start a Web server sharing the file under the current directory with the following command: $ python-m simplehttpserver 8000Jython is a Python implementation Web application server on the JVM: for example, Tomcat,tomcat is a servlet container, so any web app can be deployed in a war package where it runs. A project that contains a set of war packages needs to be packaged into an ear (or a separate war package requires some JEE services), and a full JEE application server, such as JBoss, is required.
The seventh chapter: Rapid Development PracticeOptimizing the workflow iterations of developers and teams is a process of moving towards the ultimate goal and recycling. The beauty of the project is broken down into tasks that have been developed over several iterations. This approach is suitable for every aspect of software development, including the need for mobile phones, design, development, testing, and deployment. An iteration needs to end with a visible result. The results of the iteration need to be compared to the previous state, and ultimately the desired results. In this sense, iterations can be thought of as a feedback loop, with action as the beginning and a measurable response to the end. The short-cycle iterations can get more feedback. The shorter the cycle, the more timely the feedback will be, the better the effect. Boyd iterative law: Fast iterations are almost always superior to in-depth analysis when dealing with complex analyses.
Eighth chapter: API DesignThere are two basic ways to solve a problem: by starting with a comprehensive theory, or by gradually developing a set of corresponding theories from a single detail. Design starting point: A specific design approach for client-server mode setting involves the development of RESTful web APIs to transfer data to the client view and avoid rendering the views on the server side. One problem with this is how to design the best web API in a consistent, supportive way. This type of design decision often raises many points of view, but there is always a clear consensus that the Web APIs affected by rest should not be subject to the strict limitations of controversial or impractical constraints.
Nineth Chapter: jquery and JythonSome argue that jquery is more of an internal DSL (internal domain-specific language), a view that jquery focuses on DOM manipulation, Ajax processing, and other common JavaScript tasks in small languages. Server-side: Jythonpython typically uses less code than Java to do the same work. Jython is a Python implementation that runs on the JVM. This makes it possible to create clear, concise python code in a Java-installed environment. Jython can also interact with Java objects by introducing a series of capabilities embedded in Jython or linked to the Java library. Python Web server as a scripting language, Python can also be used in a way that Java developers are unfamiliar with. For example, running a simple static Web server, he can provide file services in any directory without writing a single line of raw code. You can simply switch to a file directory and then call the following command: PYTHON-M Simplehttpserverjython Web Server using the above Simplehttpserver to create a Web-based server requires only a few lines of code: Import Simplehttpserverimport socketserverimport OS
Os.chdir (' src/main/resources ') httpd = Socketserver.tcpserver ("", 8000), Simplehttpserver.simplehttprequesthandler) Print "Sering at Port 8000" Httpd.serve_forever ()
Jython can be invoked from the command line or embedded in a Java application. For example, the script called in this Java class: package Com.oreilly.jython;
Import Java.io.file;import Java.io.ioexception;import Org.python.util.pythoninterpreter;import Org.apache.commons.io.FileUtils;
public class server{public static void Main () {new Pythoninterpreter (). EXEC (FILEUTILS.READF Iletostring (New File ("python/http_server.py")); }}/* Project and its dependencies can be on Github * (https://github.com/java-javascript/client-server-web-apps/tree/master/* Chapter-9-jquery-and-jython/jython-json-rest/rest-json). * Can be built using MVN clean install, run with MVN Exec:java */
Client: jquery its quest to eliminate duplication of effort makes vague, cumbersome javascript clearer and more brief. In the first encounter with jquery, the dollar sign in the code is surprising. This is because $ represents the namespace of the jquery object in the library. Ajaxjquery XMLHttpRequest Browser Objects in a simpler, more medical, consistent performance across browsers. Jquery.ajax is a generic Ajax requestor that can be easily applied to the HTTP GET and post methods. Because of the popularity of JSON communication in AJAX applications, it provides the Getjson method, which also provides the ability to create calls through JSONP.
Tenth chapter: JRuby and AngularServer-side: JRuby and Sinatra use Ruby and a mini-framework called Sinatra to create a simple, dynamic network API. Sinatra is essentially a ruby-based HTTP wrapper. Client: AngularJS (abbreviation: Angular) is MV*JS framework jquery and ANGULARJS:ANGULARJS compatible with jquery. If the JQUERY,ANGULARJS is not used, the built-in jquery subset is used.
11th Chapter: Packaging and DeploymentPackaged Java and JEE Application Java Archive (JAR) files are used to package Java classes and resource files into a single archive file. The jar file is compressed using the ZIP format and contains a path named: Meta-inf/manifest. MF manifest resource configuration file. You can use the jar utility provided by the JDK (http://docs.oracle.com/javase/7/docs/technotes/tools/solaris/jar.html) to generate the jar file. Simply put, the jar file is a. zip file, but contains some additional descriptive information in the Meta-inf directory. The jar is not exclusive to JEE, he is part of the standard JDK, and its specification (Http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#JAR Manifest) can be found in the JDK documentation. Jee describes several ways to use jar files. JEE Application client modules and EJB modules are packaged into JAR files. Other packaging formats for Jee are also based on jars. Depending on the functionality and content, Jee other archived files are actually jar files, the knowledge file suffix is different. You can build Jee archives manually, but you typically use build tools such as Ant, MAVEN, or Gradle.
The Web module is the smallest deployment unit in Jee, which contains Web components and resource files, primarily static content. Web modules can be packaged as a Web archive, or war. The war file has a/web-inf directory, which has a Web. xml file that defines the structure of the website application and the application of the other resources in the archive, which is extremely flexible and can be deployed to a web container that supports only a small subset of the JEE specifications. Common web containers are tomcat and jetty. Each container has its own distinct characteristics.
An Enterprise archive (ear file) that contains a war, jar, and a application.xml file that references the included modules, defines the security roles that are generated for enterprise applications, and must be deployed in the application server. The application server supports more Jeer specifications than the Web container. The ear file can no longer run inside the Web container, and he needs EJB support and some other services. Application server has jboss,websphere, WebLogic Serverjee deployment: [{(Web application) application Server} The role in server]jee describes the division of labor among the people involved in the development process, including the Deployer and system administrator. The deployer is responsible for configuring the app in the running environment, verifying that the module follows the JEE specification, and installing the application module on one or more servers. Deployment of non-JEE applications: Servers are outside of the app when they need to deploy applications to an internal system that already has an application server running, or if you want to package multiple Web apps and Jee packages into one app. Server and application in parallel without first installing the application server in the case of the server in the application, in the application code contains a Java server library. The server runs inside the Web App. Only one executable jar package needs to be created and deployed when publishing.
The 12th chapter: VirtualizationVirtual machine Realities: VMWare, VirtualBox, Amazon EC2 virtual machine Management: Vagrant, Packer, devops Configuration Management container: Lxc:linux Container (LXC) virtualization is available for LinuX systems, Allows multiple containers to run independently of one another on a single server. Docker: Extended LXC, providing a higher level of API. Like other container technologies, Docker tries to simplify the packaging and deployment of applications, creating a separate private environment for end users. In Docker terminology, a container that is running is based on mirroring. For a given container, the file system state and exit values are saved, but not the memory state. Containers can be started, stopped, and restarted. The container can also be exported as a mirror via the Docker commit command, which can then be used as a blueprint for the new container. A mirror in Docker can have a parent mirror, but the underlying image does not have a parent image. 13th: Testing and documentation
Full-end Web development using JavaScript and Java to read notes