Seeing this title, maybe some people say doubts, J2EE and .NET are not at a level, how can they put them together? It is to be pointed out that the .NET contains a relatively wide product family, including development platforms, operating systems, servers, terminal equipment, etc., and also includes service platforms. The development platform is just part of the whole .NET strategy, so it is precisely that .NET should be an .NET development platform.
With the deep development of three-story / multi-layer enterprise information system structure, the emergence of next-generation distributed computing model web services, the competition between platforms, frameworks and languages in corporate applications is also more intensified. The J2EE platform has been leading the trend of enterprise applications over the past few years, but the recent Microsoft's strong .NET platform has also begun to attract a number of IT companies and developers, and put forward a strong challenge to the J2EE platform. The technical confrontation in the field of enterprises is also opened.
It is necessary to emphasize that .NET is a strategic product, and J2EE is a standard that describes the product, and now there is a lot of products that meet J2EE standards. In the foreseeable future, they will be an important platform for building enterprise information system applications, especially important platforms for developing and deploying Web services.
Although several system platforms and languages can be used at the same time, for companies, a strategic platform is required to achieve seamless integration of data, accelerate the deployment of enterprise applications. To make the right choice, we need to fully understand the characteristics and advantages of the two platforms. This topic will be finely said to J2EE and .NET.
First, J2EE from the group
Second, .NET development platform retain windows developers
Third, the similarities and differences between J2EE and .NET platform architecture
Fourth, J2EE VS .NET: Web Services Who is the Lord?
First, J2EE from the group
Zhongnan University Luo Xinxing Bi Wenjie
The development of enterprise application systems has been facing major challenges: On the one hand, the enterprise application system faces a heterogeneous distributed environment, which must support interactive and interoperability with existing systems; another Aspects, as a platform for providing information services within customers, partners, and companies, enterprise systems must also have high availability, security, reliability, and scalability. These requirements plus complex and varied user needs and continuously expandable delivery time, making the development of enterprise systems increasingly difficult. Developers and major programmers have been working hard and eagerly looking forward to a mature, standard corporate platform to streamline and regulate the development and deployment of enterprise systems. The emergence of Java technology, especially the launch of the J2EE (Java 2 Platform Enterprise Edition platform) is the result of this effort, which also makes the development of the enterprise system become more rapid and convenient. It should be pointed out that J2EE itself is a standard that provides a standard for different manufacturers to create platform products, making interactions between different J2EE platform products.
J2EE journey
Java was launched by Sun Company in 1996 that its main use is to produce an applet that generates a dynamic web page. Later, people found Java's "once development, multiple run", pure object-oriented properties, garbage collection mechanisms and built-in security are particularly suitable for development enterprise applications. Therefore, the company's application developers have extended many enterprise applications on the Java Standard Edition, and the results have led to Java-based enterprise applications in explosive growth. However, between the enterprise system APIs cannot be compatible with each other and destroyed Java platform independence. In view of this, large enterprise application system developers such as IBM, Oracle, and BEA jointly developed a company application system development specification based on Java component technology in 1998, which defines a standard platform for multi-layer enterprise information systems. It is designed to simplify and regulate the development and deployment of enterprise application systems. This specification and its definition platform constitute J2EE. The latest version of J2EE is J2EE 1.3. It should be noted that J2EE itself is a standard, not an off-the-shelf product (although there are many products that meet J2EE standards), it consists of several parts: J2EE specification. This specification defines the architecture, platform role of the J2EE platform, platform role, and implementation requirements for each service and core API in J2EE. It is an outline of the J2EE application server developer.
J2EE compatibility test site. One test J2EE application server provides a J2EE specification site, and Sun will issue a compatibility certificate for products that are tested through this site.
J2EE reference implementation. That is, J2EE SDK, it is a non-commercial implementation of Sun's own J2EE specification, but also for the development of a free underlying environment based on J2EE enterprise application.
J2EE Implementation Guide. That is, the BluePrints document, the document guides the developer how to develop a J2EE-based multi-layer enterprise application system.
Component-container construction architecture
The J2EE specification defines a component-based multi-layer enterprise application system development platform, and its logic structure is shown in Figure 1. The elliptical representation of the figure represents the component, the large rectangle indicates the container, and the small rectangle containing the downwriting represents the API, the arrow indicates access, the text on the arrow indicates the corresponding protocol.
J2EE is a system platform based on a component-container model, and its core concept is a container. The container refers to a standardized runtime environment that provides services for a particular component, and the Java virtual machine is a typical container. Components are a deployed program unit that runs in some way in the container, and the container encapsulates the J2EE underlying API, providing transaction processing, data access, security, persistence, etc. for components. It is not directly accessible between components and components in J2EE, but is called through the protocols and methods provided by the container. The relationship between components and containers is defined by "protocol". The bottom layer of the container is a J2EE server that provides a variety of services and APIs defined in J2EE for the container. A J2EE server (also called J2EE Application Server) can support one or more containers. In Figure 1, you may have noticed services for each container including two parts: J2SE (Java 2 Platform Standard Edition) and a set of extended services. This is because J2EE is based on the Java standard version. Each container provides some extended services on J2SE, such as directory services, transaction management, data access, message mechanism, security, etc.
J2EE's core - EJB
J2EE defines four components: Applet Components, Application Customer Components, Web Components, and EJB (Enterprise Javabeans) components. The Applet and Application Customer components are running on the client. J2EE provides an operational environment through the Java plug-in to applet, and the Application Customer's container is a local Java virtual machine. The web and ejb components are running on the server. Two web components are included in J2EE: JSP and servlets. They are the functional extension of the web server, they can generate a dynamic web page. Different is that the JSP is embedded in HTML in HTML in the server, and the generation result returns the user (similar to the ASP technology). The servlet is a separate Java class, which dynamically generates an HTML file to return to the customer. The container of the web component is typically based on Java-based web servers. EJB is the core of the J2EE platform, and J2EE is the main reason for the industry's widespread concern and support. We know that a main purpose of J2EE is to simplify the development of enterprise application systems, so that programmers will focus on commercial logic. EJB is based on this ideological server-side technology, which is also a specification that defines a reusable component framework to achieve distributed, object-oriented commercial logic. EJB core thinking is to separate commercial logic with the underlying system, so that developers only need to care about business logic, and implement directory services, transaction processing, persistence, security and other underlying system logic by EJB containers.
A deployable EJB component contains 3 parts:
The Remote Interface Remote Interface Defines the method of user-calling available in the EJB component, which is usually the function or process that implements business logic (such as a function of computing commodity prices) for remote client calls. When the EJB component is deployed to the container, the container automatically generates an instance of the Remote interface, that is, the EJB object, which is responsible for the call request of the agent user.
Home Interface Home Interface Defines a set of methods to create new EJB objects, lookup, locate, and clear existing EJB objects. When the EJB component deployment, the container will automatically generate the corresponding Home object. This object is responsible for finding and creating an EJB object, returning the reference to the EJB object; the user uses the reference to call the EJB component method, resulting the result; the last Home object clears EJB Object. We can image the factory of the Home interface as an EJB object.
The Enterprise Beans Enterprise Beans class is a specific implementation class for commercial logic. It is defined in the Remote interface. According to the function, three Enterprise Beans (session beans), entity beans (Entity Beans), and Message Drive Beans (Message-Driven Beans) are defined in EJB 2.0 specification.
Session beans are in stateless and there are two types. Generally stateless session Beans simulates business logic, such as calculation prices, etc. Stateful session beans typically simulate a customer session, which will temporarily save customer information, call other Beans to access data according to customer requirements. Both session beans do not save status information or data, and when the customer disconnects or off, the session beans will disappear. A typical example of a session beans is a shopping cart on the website.
Entity Beans simulates business data, which represents a data store, which can be a record in status information or database. The physical Beans still has services to save their data after the customer disconnects or when the server is turned off. A typical example of an entity beans is customer account information.
Message Drive Beans is very similar to session beans in behavior. Different is that the message driver beans are called only when they need to send messages to these beans, such as sending user confirmation information when needed. In addition, when submitting and deploying the EJB component, two files are required: deployment description files, the container is deploying Enterprise Beans according to this file, providing the required service; EJB JAR file, it is a deployment unit submitted to the EJB container, The container (Application Server) is unmarkled at the deployment, loading Enterprise Beans.
The EJB container is very complicated, which is generally provided by a professional J2EE application server developer, and the more popular EJB container is provided by IBM's WebShpere, BEA's WebLogic Server, Sun's IPLANT and other application servers. In addition to providing transaction processing, directory services, persistence management, and security services, EJB containers are also responsible for EJB deployment, release, and lifecycle management.
Platform standard service
The service is between components and containers, as well as interfaces between containers and J2EE servers, which is a series of APIs and protocols on the implementation level. The J2EE platform defines a set of standard services, some of which are provided by J2SE, some of which are J2EE's extension of Java.
Directory Services JNDI (Java Name and Directory) provides a unified interface to complete the standard directory operation, because JNDI is independent of the directory protocol, the application can access various directory services, such as LDAP, NDS , DNS, etc.
Data Access JDBC (Java Database Connectivity) API provides a unified approach to accessing different types of databases, shielding details of different databases, with a platform-independent. In addition to requiring the core JDBC API (included in J2SE), the JDBC API (included in J2SE), also requires extended JDBC API 2.0, which supports rows, connect pools, and distributed transactions.
Transaction Processing JTA (Java Transaction Architecture) defines a set of standard interfaces to provide reliable transaction support for your application. JTS (Java Transaction Service) is a Java implementation for Corba OTS transaction. JTS specifies the implementation of the transaction manager, which supports the JTA standard in the high-level support, and the Java mapping of the OMG OTS specification is implemented at the bottom.
Message Services JMS (Java Message Service) is an API for communication with intermediates for messages.
It supports both point-to-point messaging, also supports publish / subscribed messaging. Email JavaMail API allows sending and receiving emails in a stand-alone, independent protocol in an application. JAF (JavaBeans Activation Framework is responsible for processing MIME encoding, JavaMail utilizes JAF to handle MIME encoded mail attachments.
CORBA Compatibility Interface RMI (Remote Method Call) is a Java local method that communicates between distributed objects, which causes the application to call remote methods like calling local methods, and does not need to consider the location of the called object. RMI-IIOP is an extension of RMI, which is an object communication protocol that complies with CORBA standards and a J2EE default component communication protocol. Java IDL allows J2EE application components to access the external CORBA objects through the IIOP protocol.
Security Services JAAS (Java Authentication and Authorization Service) Use two steps to implement security: authentication, that is, the user provides authentication information (such as user name and password) to obtain system authentication, this process is also called login; authorization, in After confirming that it is legal user, the system grants its corresponding permissions according to the user's role. J2EE's authorization is based on the concept of security roles, and a security role is a logical group with the same privilege. J2EE's security role is defined by the application component provider. Web services support current J2EE does not provide support for Web services. Sun provides an API and its implementation of WSDP as an extension to J2EE, but is not currently the J2EE specification. In WSDP, JAXP is used to parse the XML document; JAXR registrations Web Services to the UDDI server; JTX / RPC sends and receives XML documents with XML-based protocols such as SOAP; JWSDL processes the WSDL document. Although J2EE is not born for Web services, it is now working hard to catch up with the web service.
Multi-layer application model
From an application perspective, J2EE provides a multi-layer distributed enterprise application model for the development of enterprise application systems. In J2EE, the application logic can be divided into different types of components according to the functionality, and each component is distributed in different machines depending on their layer, and together form a component-based distributed system.
As shown in Figure 2, J2EE defines a typical four-layer structure, which is a client layer, a web layer, a business logic layer, and a corporate information system layer.
At the time of application development, the four-layer model defined by the J2EE can be used flexibly according to the actual situation. Since other components except Applet can access databases, EJB components, and enterprise information systems, there is a number of application software development models, such as web-based four-layer models, based on the Web-based four-layer model, three-level models based on the desktop application. The layer model (excluding the web layer), the B2B model (excluding the customer layer), etc. If the application is relatively simple, it is generally not used as a logic layer, and commercial logic and data access are directly used, and the EJB development and deployment costs are quite high.
Second, .NET development platform retain windows developers
Nanjing University of Posts and Telecommunications Li Jianzhong
The .NET development platform is launched, starting with the competition with the J2EE platform. Most of it is the overwritten of Microsoft Windows DNA (Distributed Network Architecture), DNA is a platform for Microsoft to develop enterprise applications. The Windows DNA includes many technologies that have been confirmed, and the new .NET framework replaces these technologies and includes web service layer and improved language support. From a strategic perspective, .NET development platform is responsible for the weight of the .NET strategy, but its most direct goal is to work hard to keep the huge Windows user base for Microsoft.
Microsoft's Windows Development User Group is Microsoft's maximum wealth through the Windows operating system. For why it is to launch .NET development platform, Microsoft said that one of the main reasons is that these users may cause these users to turn to other platforms because Java is committed to the developer's hardware and operating system. Although the development platform itself does not bring a lot of benefits to Microsoft, Windows programmers are the main support for Microsoft products, and the developers of commercial software have formed an important channel to sell Microsoft products to customers. If Microsoft allows developers to write applications on the .NET development platform, there will be more companies to buy Microsoft's other products.
Aware .NET
Knowing the best way to see what it does. The .NET strategy uses the Internet itself as a basis for building a new generation of operating systems, and extends reasonably to the design ideas of the Internet and operating systems, enabling developers to create applications-independent applications in order to easily implement internet connection. .NET includes a relatively wide range of product families, which are built on the XML and Internet industry standards, providing users with the development, management, application, and experience of web services. Figure 1 is an overall description of the .NET strategy. Five aspects of the .NET strategy include: .NET Development Platform This is a set of software components for establishing a web service application and Windows desktop applications, including .NET Framework, NET Developer Tools, and ASP. Net. The Visual Studio .NET released in March this year will be an important product in the RAD development tool.
The .NET server can provide a wide-ranging aggregated and integrated web services to build the backend base of the .NET platform. .NET basic service password authentication, calendar, file storage, user information, etc. are essential. Microsoft is constructing. Net My Services and other basic service platforms can be used in this regard.
The .NET terminal device is widely connected to the Internet and experiences the terminal device of the web service is the front-end basis for .NET. PC, PDA, and various embedded devices will play in this vast world.
The .NET user experience can meet the user experience of people's various needs is the ultimate goal of .NET, and the value of .NET value.
Among these five components, the .NET framework in the .NET development platform is the most challenging part of the .NET software constructor, other four parts are tightly integrated around the .NET framework.
.NET frame core
The .NET framework implements the functions of language development, code compilation, component configuration, program operation, object interaction, etc., providing web services and ordinary applications with a managed, secure, and efficient execution environment. All applications created on the .NET platform require two core modules: Common Language Runtime (CLR, General Language Runtime) and the .NET Framework class library. The CLR is a software engine that confirms that they can run without incorrectly, and perform appropriate secure license verification, execute applications, and will be cleared.
The .NET Framework class library provides software components to programmers to write code running under the control of the CLR, which provides a huge function set in accordance with a single ordered hierarchical organization, including networks from file systems to XML features Every function of access. This class library provides three basic programming templates for development: ASP.NET web form applications, based on ASP.NET web service applications and Windows applications based on traditional GUI interactions. Figure 2 depicts the composition of the .NET development platform.
CLR - virtual machine
The CLR provides a hosted code execution environment for the .NET application. The hosting means that the work made by the programmer or operating system is complete, so that the program operates to run higher security and stability. These tasks include memory management, instant compilation, component self-description, security management, and code verification, and other system services. The CLR provides a technical specification, regardless of what language written in the program, as long as you can compile into an intermediate language, you can run in its support, so that the .NET application can be independent of the language. The CLR also provides direct support for component-based programming in the application operating environment, such as their support, event, object, inheritance, polymorphism, interface and other component programming characteristics.
The automatic garbage collector in the CLR is responsible for the memory allocation, object layout, memory release and other memory management issues at the time of the .NET application runtime, which completely solves the problem of memory leaks in programmers for many years, which greatly enhances the robustness of the application.
The instant compiler is dynamically compiled into a binary code in units of the intermediate language in the middle of the time.
The intermediate language is the language of the PE file (Windows executable) output PE file (Windows executable), which provides multi-language support for the .NET platform, allowing developers to use more than 20 different programming languages. The metadata is a collection of forms embedded in the PE file, which describes the information that the data type in the code is required to know when the code execution is executed. Metadata makes .NET application code to provide self-description characteristics, providing type security, which requires additional type libraries or interface definition languages (IDL). The CLR determines the trust of each component according to the source of the managed component (such as the Internet, Enterprise Local Area Network, Local Machine) and other factors, and defines the permissions of sensitive operations such as reading files, modifying registry, etc. depending on trust. In addition, the CLR strict security checks for code types by means of a common type system, avoiding types that may exist between different components. Through the code access security mechanism, developers can specify the permissions necessary for the application to complete the work. The CLR not only specifies the code access security, but also the role-based security. Role-based authentication provides security guarantees for the implementation of distributed components on the Internet.
It is worth noting that CLR usually hosts in other high-performance servers applications, such as Internet Information Server (IIS), SQL Server Database Servers, etc. In this way, developers can use the CLR many security and efficient advantages to deploy their business logic.
Class library - components and services home
The .NET Framework class library consists of a wide range of, object-oriented, can be used for a reusable class set for any programming language. It provides almost all applications that need to be needed; on this is a lot of application templates, these templates provide specific advanced components and services for developing network sites and network services, whether it is a traditional command line or Windows graphics? Interface programs, or ASP.NET or Web service applications for next-generation Internet distributed computing platforms. Like the code library sent in Windows and its SDK, the .NET Framework class library liberates programmers from heavy programming details, while focusing on the business logic of the program. It encapsulates the core Win32 API's most commonly used function and plug-in SDK to a unified package, and packet and descriptions for class libraries in clear and organized ways so that developers can make it more convenient to find their applications. Most of the features needed. Below is some of the core services it provides:
System framework
The service framework includes a base class library that developers wants to exist in a standard language library, such as a collection, input / output, string, data, etc. The base class library also provides classes that access operating system services such as drawings, networks, threads, encryption. In addition, the service framework also includes data access class libraries and development tools.
ADO.NET components
ADO.NET provides data access services for network-based, scalable applications and services. It not only supports traditional link pointer-based data access, but also provides high performance access support for more suitable link data templates that are more suitable to return data to the client application.
XML data components
Through its developers, you can perform XML conversion, transmission, and confirmation of any data, all data can be seen as an XML format. At the same time, the system also supports universal conversion between ADO.NET data and XML data.
Windows form assembly
Windows form components provide developers with a powerful Windows application model and a rich Windows user port, including traditional ActiveX controls and new interfaces of Windows XP, such as transparent, hierarchical floating windows. Powerful support for CLR is also one of the exciting places of Windows form components.
ASP.NET application service
The core of ASP.NET is its high-performance running language based on low-level HTTP requests, which greatly improves its performance. ASP.NET uses components-based .NET framework formulation template, so it obtains advantages such as XCOPY formulation, component parallel formulation, XML formulation. It also supports real-time updates for applications while providing high-speed buffer services to improve performance. ASP.NET web form
The ASP.NET Web form brings the advantages of VB form high efficiency to the development of the web application. The ASP.NET Web single supports the traditional ASP syntax that mixes HTML content with script code, but it proposes a method of separating application code and user interface content, more structured. It provides an ASP.NET web form control for mapped traditional HTML user interface components (including list boxes, text boxes, and buttons) and a more complex web application control (such as calendar and advertising transfer).
Support for web services
ASP.NET Application Services Architecture provides an advanced programmable template for establishing a web service with ASP.NET. While establishing a web service does not limit the use of specific service platforms, many advantages of ASP.NET will simplify its development process. Using this programming model, developers do not even need to understand HTTP, SOAP, or any other network service specification. ASP.NET can utilize existing architectures and applications to provide a simple, flexible, industrial standard model for binding applications on the Internet.