Finally understand the next. NET and Java EE difference _c# Tutorial

Source: Internet
Author: User
Tags change settings connection pooling exception handling ibm db2 object model websphere application server
About. NET technology compared to Sun's JAVA2 Enterprise Edition (J2EETM), many customers want to understand Microsoft's views. For several reasons below. NET and Jee are a bit tricky:

1 Generally speaking, the Windows. NET Framework is a well-defined technical part of Microsoft's Windows system, while the Java EE is a written protocol. If it is not limited to academic discussion, in other words, to discuss the commercial value of the topic on several application platforms, it is meaningless to compare the Java EE and a practical tool only.

Such practical tools as IBM's WebSphere Application service, BEA's WebLogic service, or other similar application services.

For satisfactory analysis, only comparisons between products, such as comparative development efficiency, are performed. Using Java EE, developers need to create 4 components to build a single EJB. On the face of it, it's just a bit of a price to pay for development efficiency. But some Java development tools hide some of the development techniques and reduce efficiency. Another example, the Java EE deployment system is very complex and difficult to solve, the class embedded in the jar, and the jar embedded War,war and embedded ear. But to some extent, some tools can automate the deployment process. These situations lead to a key factor in determining the business value of an application service due to different vendors, depending on the efficiency of the development tools.

2 about "Java-ee All-Star team" problem. When compared. NET and the collection of all components of Java EE, this problem arises. For example, analysts may encounter the following issues when considering development efficiency, company A's products, B Company's application service procedures, C Company's safety rules, D company installation, E company decided the price. All of this may be related to the Java EE. Set these feature attributes, the Java EE tool looks good: cheap, easy to install, fast, high security, super cache, and a great development tool, and so on. But that's irrelevant-because it's impossible to get all of these features at the same time. In fact, only one accurate feature can be obtained at a time. Because these products come from different companies, they cannot cooperate seamlessly. For example, IBM's tools cannot work with Bea's WebLogic service because the latter is a caching engine for Oracle companies, and Oracle's engines are not available at Iona prices, and so forth. People sometimes mistakenly use "all the features of Java EE" as the basis of comparison, but this is unreasonable. What customers need is to know a one-to-one, product comparison to the product.

3) comparison. NET and Java EE are important to ignore other application platforms. Java EE is a specification that focuses only on application servers. But the vast majority of customers are interested in: application servers, ports, business servers and analytics tools, databases, data separation and mobility, information agents, application collections, capacity management, smart clients, and so on. As a response to customer requests, these factors should work together, and all major vendors should implement a consolidated platform. such as Microsoft's platform (including Windows system client and server, Windows. NET Framework,visual Studio.NET Framework, and Microsoft Enterprise Server) , Bea's WebLogic platform, IBM's WebSphere platform, Oracle's platform, and a sun company platform. Focusing on one of these platforms (application servers) will lead to a problem similar to the "woods and forests" relationship. Such an analogy is appropriate, but it should be considered as part of a broader platform.

From a Microsoft perspective, these are key similarities and differences between the Windows. NET Framework and the Java-based product, compared to those uncommon warnings.

Similar points

1 the Windows. NET Framework and Java all have a controlled run-time environment that not only converts source code into intermediate languages, but also compiles executable code for the cost of these intermediate languages. Both environments support defragmentation, dynamic class loading, and exception handling.

2). NET and Java both advocate and support component-based design, polymorphism, inheritance, and interface, and also provide the Basic class library to perform I/O, XML processing, database access with connection pooling, text manipulation and Web script writing.

3) Both are published through a unique vendor's product. The Java EE specification itself is "sales neutral", but in practice those conforming to the specification must implement features outside the specification, such as management features or expansion features. Therefore, these products must be corresponding to the specific vendor. For example, Microsoft Company's windows and. NET systems.

4 the Windows. NET framework and the Java EE products all work with third party products. For example, in the back-end Database realm,. NET and Java based applications are able to access data stored in Microsoft SQL Servers, IBM DB2, Oracle,informix, Sybase, and other servers. To give another example,. NET and Java based systems can access popular information intermediary devices, such as Microsoft's MSMQ or IBM's MQSeries. Also include file system, third party development tools, code version system, firewall, etc.

Different points

1) principle

Java EE is a single language platform that focuses on portability across platforms. This means that, to take advantage of Java EE, the design can use one of several operating systems, but the developer must be trained to do so. The. NET architecture provided by Microsoft is part of a Windows system. Developers can use multiple languages and are highly efficient without having to do a new language retraining. However, the. NET framework is part of a Windows system.

2 width and breadth

A.. NET includes code, products, tools, and architectures to leverage all computing resources on the network, including devices, PCs, and servers. NET enables all of these devices to be connected by a standard communication protocol, called an "XML Web service." (. NET applications can connect to any system, regardless of the language and platform of the system, or even the Java EE.) As long as the target system complies with the XML Web service standards. The. NET model is a wide range of distributed computing that communicates with and exchanges information with many code.

B. Java EE is a server-oriented model that does not develop intelligent and computational capabilities on the network. In general, Java-based products only support server-side applications. Java EE generally regards the PC only as an HTML browser, and these devices are considered dumb terminals. As for XML Web services, existing protocol standards support distributed computing, and the existing version of the Java EE specification does not mention the problem of XML Web services, but Java based products can support XML Web services after adding additional appliances. However, adding additional devices means there are strict restrictions. For example, it is not clear whether an existing specification allows an EJB to invoke a Web service, although the components of a Web service can invoke some EJB programs.

3 The consistency of the programming model

The Windows. NET Framework provides a consistent, component-oriented model across servers, PCs, and other devices. While Java-EE provides EJB as a server-side component model, creates open, fully Java-written APIs for clients or local components, provides a servlet for the user interface, and provides a different model for mobile devices. Even within the EJB there are at least 3 distinct child models, each of which has a different language definition.



Compared to the Java platform, Microsoft's. NET programming model has better consistency across a variety of servers and clients. J2SE is an open, fully Java-written API, and Java-EE is based on a java-based servlet and EJB.

DH Brown, July 2002



4) function

A. The Windows. NET Framework provides a recognizable version of the ClassLoader, which means that the application's developers can ensure that the application they are developing can still run when some code has been updated. Java and EE (now) have no version-aware ClassLoader, which means that developers and administrators cannot guarantee that the code will be executed correctly. Or, developers can only rely on luck to ensure this.

B. The Windows. NET Framework shows class attributes at the language level-which makes programming simpler. For example, you can use only one simple attribute in your source code. NET component flag is processing mode. or that one. NET components and the serialization of XML can be defined in a property. This mechanism greatly simplifies many programming tasks. Java does not display class attributes on the language layer, although sun has taken into account the need to modify the Java language to change the status quo. This change is expected to be implemented for the first time in two or three years.

C.. NET also supports the separation of data access, which is used primarily for applications running on mobile devices or occasionally networked situations. The data can be manipulated offline and then synchronized with the starting data. Both the Java EE and j2se at this stage do not support the separation of data access, the need for this feature Java developers must write their own "plumbing code."

D. To establish a web-based user interface, the Windows. NET Framework provides an event-based model similar to the smart client model in popular Visual Basic. The ASP. NET model makes it easier to build, publish, and maintain a web-based user interface. In contrast, the Java EE does not support such a model in JSP. Some third-party extenders partially compensate for these features, but their usefulness and simplicity are not the same as those of the ASP. NET comparison. As a recommended Java EE add-on, this may be done by the faces Server. But this add-on was not included in the 1.4 version of Java EE. It takes at least one year to get the support of the sellers.

E. Java EE supports an object-dependent data image model, which is called an EJB Entity Beans. This is to allow developers to easily build an object model from a related database. However, actually programming this idea into reality has to do with the following questions:

Ⅰ. Ease of use: when the familiar, well-defined, widely supported Structured Query Language (SQL) interacts with the developer's data, developers have to discard them, using a weak definition query language called EJBQL. Like SQL, the EJBQL is not powerful (for example, in an existing specification, it has no statement of order BY, so that developers cannot use SQL extensions for a particular database), and its semantics are not formally defined. Also, it is difficult to establish relationships and dependencies between objects, and the translation of data between objects and between XML and back-end is manually controlled.

Ⅱ. Performance: The performance of an EJB based system is still an unknown. No public benchmarks were provided. The customer reflects that the performance is far from the entity Beans and turns to a more direct data access strategy. This is one of the key factors that EJB Entity beans is not widely used.

In the Windows. NET Framework, data access is based on a dataset comparison. A dataset holds a subset of related data that is described by one or more SQL query statements. Data in a dataset can hold key links, and developers can manipulate the data directly, convert the data into XML format and the type of last operation, and use standard SQL filtering data. All in all, relative to EJB Entity Beans,. NET data set model provides a richer and more simple and familiar way.

5) Simplicity

A Configuration: For Java EE, configurations are XML-formatted files that are obtained by deploying descriptive information, and they differ significantly from the actual commercial logic code being executed. There are many problems with this approach. First, with regard to the metadata of a particular class, changes in some code and changes in metadata are interdependent. The synchronization requirements for two separate files may cause errors. Second, given the metadata of the application layer, in Java EE there is no way to inherit metadata from one program to another. Unlike Java EE, Windows. NET architecture includes this feature so that you can add properties directly to the class in your source code so that you do not have the first problem. Windows. NET allows customers to add extenders themselves so that developers can write and use their own properties. To configure external metadata in the. NET architecture of Windows, this feature is included in the profile system of the configuration file, which inherits properties from the parent system so that each file is small and records only the change settings. This avoids the second problem of the Java EE model.

b Database connection pooling in the Windows. NET framework, these pools are automatically established and managed as needed. In the Java EE model, the connection pool must be explicitly configured and managed.

C XML Web services: building an XML Web service in. NET is as simple as adding a property to a class. Some java-based products also want to simulate this feature in Java. NET provides a simpler way to build and use an XML Web service that can be manipulated by both parties.

D Deployment: In. NET, to deploy an application, the administrator only needs to copy the files. In Java EE, the administrator must bind a number of compiled files and jars, war, and Ear, and then unpack and run them in a particular server deployment tool, and then copy the resulting file. This multi-step deployment process means that a typical edit/compile/debug cycle is greatly extended. In addition, because of some changes in the dynamic load class process, updating a simple class often requires a restart of the Java-based server.



Although many companies have chosen Java as a strategic platform for enterprise development, their use has been hampered by the complexity of EE. Meta group,8 Month



6) Cost

A To deploy, a server-side application that runs outside of the windows. NET framework requires a license from Windows Server, which is much cheaper than any of the three Java-compliant commercial servers. The difference in system deployment costs, which includes four network servers, can be up to $ hundreds of thousands of. For example, a four-machine system for Microsoft Windows Server 2003 (Enterprise Edition) (each with four PCs) has a license fee of not more than 16,000 U.S. dollars (this takes into account the retail factor). While WebSphere Application Server 5.0 has a license fee of $12,000 for each PC in the same system, it costs 192, 000 dollars. This ratio is 12:1. Most of the price of a business application server based on Java EE is similar to this. (This assumes an equal performance.) In fact, however, Middleware's October 2002 report shows that an application built on the Windows. NET Framework is 2-4 times more efficient than a program built on a similarly popular Java-based server. So in fact the price advantage is much higher than 12:1 there are a lot of free, based on Java EE Open source application server, but they do not j2ee-compliant trademarks. There are also questions about documents and products: the need for comparisons between products to discuss licensing fees.

b The cost of developing tools for the Windows. NET framework is also lower. Visual Studio. NET is a. NET integrated development tool, and its licensing costs are significantly lower than the cost of development tools developed by commercial Java EE vendors. And in the industry, Visual Studio. NET won a series of prizes as the best development tool. You have evaluated visual Studio. NET and its competitor customers say that, compared to the best Java tools, Visual Studio. NET development efficiency is higher (giga,2002 year June).

C The development and maintenance costs of using the Windows. NET Framework are lower. Experts say licensing fees are not the biggest expense of a project. Typical software development and maintenance accounts for the total cost of the project (glass,2002;kemerer,1995;gartner,2001) 50-80%. Middleware's October 2002 study shows that a given application development in the Windows. NET Framework requires only 1/3 of the code for Java EE. The less code means that maintenance is simpler.

Summarize



It is obvious that the right product selection decision cannot be made without evaluating the actual product. Comparing Microsoft Windows Server with the Windows. NET Framework and Java EE (Sun Company specifications) is valuable, but such efforts lack an assessment of the actual product. However, there are some conclusions to be drawn from it:

1 Java EE shows a server-centric principle and focuses on EJB and resolution of "related object image problems". Java EE has lagged behind in supporting XML and Web services. The principle of the Windows. NET Framework is a large scale of distributed computing that leverages protocol standards and XML to take full advantage of servers, interfaces, and devices.

2 in relation to programs written on the Windows. NET Framework, the Java EE application requires more code to perform the same tasks.

3 The management and deployment model of Java EE is more like a host model, which focuses on protecting and restricting scarce computing resources, using ratios. The principle shown by the Windows. NET Framework is that computing resources are inexpensive and will be cheaper, but deployment capacity will retain most of the expensive resources.

In short, if a project requires you to select one of several operating systems as a deployment platform, regardless of development costs, forcing (and retraining) the developer uses a single programming language to execute the project, so that the version problem of the code is no longer important; it is important to allocate and restrict relatively inexpensive computing resources It makes sense to use expensive and complex development and maintenance tools, and writing more code has its advantages--the Java EE may be a good choice.

However, if the business objectives show the optimal development efficiency is important; low price/performance is more in line with requirements; interoperability with the standards of communication protocols is of high value; It is important to support a large number of interface-based applications and mobile applications; more interested in scalability-so, to build a The Windows Server application on the Windows. NET Framework is the right choice.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.