This Technology Letter examines what makes up an enterprise application and provides a comparison of the .NET and Java technologies in terms of selected decision criteria. Without delving too deeply into the technical details, the information provided here should serve as a decision-making aid and help you to select the right technology.
This article is written primarily for persons who are responsible for selecting the technology for future projects. Due to the diverse nature of the criteria that are covered as well as the given examples, this information can serve as a reference for managers, project supervisors and other parties who are involved in the decision-making process.
Context for an enterprise application
An enterprise application normally has a great number of stakeholders. Each of these parties naturally prioritises the various functional and non-functional requirements from his own perspective. In the development of an enterprise application, however, there are various non-functional requirements (quality characteristics) that play a significant role. For example, if a web application is developed that many users will have to access simultaneously, this must be taken into account in the development process. This fact will have an influence on non-functional requirements such as the performance and security. The following figure provides an exemplary illustration of the environment for an enterprise application along with a list of some of the decision criteria that are relevant here.
Multi-operating system capability It is increasingly common for enterprise applications to be deployed in different environments or on different operating systems (OS). Accordingly, the demand for multi-OS capability is growing. Java was built from the ground up such that programs can be used on multiple operating systems without any changes. The Java Virtual Machine (JVM) makes this possible by translating the program into byte code, which is then converted into machine code and executed on a given operating system by a native version of the JVM. This ensures that operation is possible on your desired target system at any time. The .NET Framework was developed for Windows-based operating systems. All versions can be used starting with Windows 2000. However, an up-to-date version of Windows is required to take advantage of the very latest features. The “Mono Project” has developed the only existing adaptation of the .NET Framework to other operating systems. Although there are some fundamental limitations, it is fully compatible with the latest Framework version 4.0.
In most cases, an enterprise application actually comprises multiple applications which are either independent parts of a whole or function with one another as integrated parts.
Java can be used to implement any type of application. Desktop applications are developed using the Swing Framework, and there are now many extensions available to simplify and accelerate the development process. For web applications, there are standard solutions such as Java Server Faces which build upon the language as well as various established frameworks from third-party providers (e.g. JBoss Seam, Wicket etc.) which have implemented solutions for everyday problems and also help to reduce the development expense. In the case of mobile applications, there is a natural limitation to devices that support Java solutions. However, applications are implemented, for example, for the Android mobile operating system with Java. All it takes to get started is to download a software development kit (SDK) from Google. Other possibilities include iPhone development with XMLVM or Java ME for devices that support Java. .NET can also be a good choice for the development of all types of applications. For development of graphical desktop applications, there are two different technologies that are available. The older one is WinForms which was available beginning with the first version of the .NET Framework and remains a basic component in the latest version as well. Since version 3.5 of the .NET Framework, the Windows Presentation Foundation (WPF) has also existed as an additional choice. This GUI technology incorporates XML markup and is designed to simplify the division between design and application logic. For development of classic websites, there are the ASP.NET and ASP.NET MVC technologies. For interactive and multimedia content, Microsoft has developed an alternative to Adobe Flash known as “Silverlight”. Mobile devices equipped with a Windows operating system can be programmed with the .NET Compact Framework. For development of iPhone applications, there is the paid MonoTouch software from Novell which covers all of the iPhone functions. For Android applications, there is also Mono for Android (“MonoDroid”). However, it is still in a private beta phase.
If you wish to cover a diverse range of application cases, you can no longer use a universal language at this point to describe everything. Flexibility, convenience and fast development cycles all demand a language uniting all of these properties and which can be said to be “dynamic”. For some time now, various scripting languages have existed that came about in response to missing language features in Java. A few examples are Groovy, JRuby and Jython, among many others. Current hype is directed towards the Scala language which unites the features of object-oriented and functional programming. All of these languages can also access the Java API, but they typically make it possible to formulate the source code more efficiently than Java does itself. The source code that is written is generated at runtime in the form of byte code for the JVM and converted accordingly by the JVM into machine code. The oldest and most common languages under .NET are C#, VB.NET and C++. C# was specially developed by Microsoft as a .NET language and offers the most language features. Many parts of the actual .NET Framework are implemented in C#. At this point, however, practically every language with every dialect is available for the .NET Framework. Examples include J# which is based on Java, IronRuby which emulates the Ruby dynamic programming language, and even exotic languages such as Lisp.
When developing applications, the development team uses a development environment that is customised for the language they are using. This environment supports the developers with all of the problems described here – a characteristic that applies without exception to all of the common environments. The environment is thus a very important component for development of enterprise applications since it can reduce the development time by providing support in diverse forms. Some examples of Java environments are Eclipse, NetBeans and IntelliJIDEA, but the latter must be purchased for a small fee. Some examples for .NET are Visual Studio, SharpDevelop and MonoDevelop, but Visual Studio is the most comprehensive and professional solution. However, some versions must be purchased.
Collaboration tools are another important factor in enterprise projects. The efficiency of co-operation within the development team revolves around such tools. They include version control systems for management of different versions of the source code and other artifacts, bugtracking systems for error management in applications, and change management systems to support the entire software development process. Normally, such systems can be integrated into the development environment. Since these tools are independent of the technology that is used, they can be integrated into development environments using extensions (“plug-ins”). Collaboration tools exist in both free and paid versions. Collaboration tools include JIRA, Bugzilla, Subversion (SVN), CVS, GIT, ClearCase and others. They can also be used outside of the Java environment. However, since Microsoft offers a very well integrated solution, it is usually the preferred choice for Windows environments. In the .NET environment, the Team Foundation Server (TFS) is very popular since this solution from Microsoft covers all aspects of the software development process.
In order to operate an enterprise application, an application server (AS) is required which provides the runtime environment. The AS is the foundation of an enterprise application and provides it with all of the necessary enterprise services. An application is distributed as a Java-specific package on one or more instances of an AS of this sort. An AS is implemented to conform to the Java standard, which normally allows switching from one AS to another. Application servers are available for free (GlassFish, JBoss AS) and also as paid versions (IBM Websphere). Under Windows, there is the Internet Information Server (IIS) for the .NET Framework. This web server is included with the purchase of a server operating system from Microsoft. Microsoft has also announced a free express version. Depending on the particular application, the IIS can be used as a web server, a host for WCF services or for various other server-based applications.
Data access in an OO environment
Enterprise applications typically use relational database systems to manage their data. Object-oriented database systems are not very popular, and this is due primarily to performance problems that exist in case of more complex object relations. In order to also be able with work with relational databases in object-oriented languages, the concept of object-relational mapping (ORM) was introduced. This allows relational databases to be linked to the corresponding objects. Here, Java has two standards: JDO and JPA. JPA is the newer variant that is preferred by many. For example, Hibernate from JBoss is implemented using the JPA standard and can also be used free of charge in commercial applications. Experience suggests that ORM provides significant added value in enterprise applications in terms of convenience, simplicity and speed during the creation of programs. Besides the many products that have been ported from the Java environment such as the popular NHibernate, Microsoft also offers a carefully thought-out and complete solution in the form of its Entity Framework (EF). The early versions of this product were not yet very mature, but the latest version EF 4.0 is very impressive. LINQ to SQL was previously developed in parallel but is no longer recommended for future projects since its development was halted beginning with .NET version 3.5. Besides the frameworks that allow object-oriented access to data, there is still always the possibility to query and manipulate data using ADO.NET.
Modular design of an enterprise application allows one development team to work independently of another team. This plays an important role in outsourcing, for example. Moreover, it also makes it possible to limit the details that must be known, and modules can be integrated and used by other teams. This makes modular design an important criterion in order to facilitate smooth implementation of an enterprise application. Java supports modular design only through division of source code into package structures that are packaged in Java archives and can then be integrated by other program components. Unfortunately, the Java standard does not define any sort of “true” modular design in which, for example, two different versions of a module can exist and be installed simultaneously. Moreover, modules cannot be added at runtime and removed again. In order to tackle these and other problems related to modular design, the OSGI Alliance has developed the OSGI Framework, which is a solution that facilitates “true” modular design. Currently, there is a project underway by the name of “Jigsaw” which should bring modular design to the Java language. This was originally planned for Java 7, but it has now been pushed back to Java 8. During the development of .NET, Microsoft has worked consistently to take the best parts of other languages while avoiding known weaknesses. Accordingly, modular design has been realised differently in .NET. Classes can be divided into namespaces. In terms of their basic structure, they are similar to the package structure in Java. However, a namespace is not limited to a single file (assembly). Instead, it can be divided among many different assemblies, just as an assembly can also have multiple namespaces. In the file system, an assembly typically has a file name that ends with “.dll” or “.exe”. However, it is not identified solely based on this name. Instead, a combination of characteristics such as the version, strong name, culture and the previously mentioned file name without the ending is used. Based on this combination, several different “versions” of a file can be installed simultaneously in the Global Assembly Cache (GAC) and used by .NET applications. Basically, the CLR always checks the GAC (in addition to the current execution directory) to see whether a needed assembly is present there. .NET also supports binding of assemblies at different times. This enables dynamic loading of assemblies required at runtime.
In order to ensure that an application still functions properly after an extension or change, tests are written which can be performed automatically following a relevant source code change. For Java, there are several established frameworks that can be used to test code in terms of the functionality or requirements. Some examples of such frameworks are JUnit and TestNG. There are also frameworks for testing with a lightweight container. This means a streamlined version of an application server is used for testing in which basic services are present, e.g. during testing of EJBs. For “simulation” of integrated components, there are also mock frameworks that exist for Java such as Mockito which ultimately extend the unit testing. Under .NET, unit testing is a fixed part of the development process. Microsoft provides the integrated “MSTest” unit testing framework for this purpose. It is very similar to the somewhat better established NUnit in terms of the functional scope and how it is used. Each of these unit testing frameworks can be extended as required using mock libraries. RhinoMocks is very popular, and is also one of the most comprehensive libraries in this area. The moq library uses a very interesting approach. As opposed to unsafe string assignments, moq is absolutely type-safe. The entire functionality can be defined using LINQ queries.
Applications or completed parts of an application must be installed on the desired runtime environments in order to be executed. This process is known as “deployment”. Both technologies have their own solutions in this area. Java enterprise applications are installed on an application server as an enterprise archive (EAR), web archive (WAR) or combination thereof. These archives can be created with all of the common development environments. Moreover, it is possible to create the EAR using a build tool such as Ant or Maven. Java includes the basic tools needed here, and they are integrated and extended by other tools. Except for the preinstalled .NET Framework in the corresponding version, applications that are written using .NET do not have any further external dependencies. Registration of runtime libraries is entirely unnecessary. This means an application in .NET can be executed at any arbitrary location. Only the necessary libraries (DLL files) must be installed in the Global Assembly Cache (GAC) or copied to the same directory as the executable EXE file. The GAC is a special system directory into which assemblies can be copied for use by all applications systemwide. This deployment and installation method developed by Microsoft is available exclusively for .NET. In contrast to the customary procedure, no installation routine is involved. Instead, a user executes the program directly from the Internet (network source). This ClickOnce mechanism ensures that any necessary directories and links specified by the developer are created the first time the software is launched. If the developer does not define any other behaviour, the program checks to see whether a new version is available each time it is launched and updates itself automatically if necessary. All of the procedures can be configured when the ClickOnce package is created and adapted to handle the actual situation. ClickOnce applications ensure secure installation and subsequent usage since this technology only allows execution of programs that do not contain any security-critical actions.
For both technologies, there are a number of build systems that automatically create the intended application at the desired times. At the same time, a system of this sort executes the tests created by the developers and indicates whether a component is faulty after a new feature is implemented. The processing is logged and processed graphically. A build system should definitely be used to enable consistent testing of the functionality of an application. Build systems are available in both free and paid versions. These systems are language-independent and generally support a wide range of build options that are used accordingly in the Java and .NET technologies. Popular build systems are TeamCity from JetBrains and CruiseControl. For example, an application can be generated using Ant scripts for Java. Using solution projects, an application is generated with Ant for .NET.
The documentation that exists for a given technology is a very important factor in the selection process. Because, if there is a total or partial lack of documentation, the use of the technology will generally be much more difficult – with a negative impact on the productivity. Since the language is so widely used, Java has a large range of documentation available in both electronic and printed format. Frameworks that extend the language with additional functionality are generally also very well documented and can be used without major expenditures. Java also provides a way for the implementation team to describe the purpose and functioning of a component they are building. Using export functions, this type of documentation can then be distributed to the whole team. The .NET Framework has comprehensive documentation in multiple languages that covers the entire framework in all of the versions released so far. In most cases, further examples are included for the languages C#, VB.NET and C++ (Managed) in addition to the API description. Vast quantities of books and Internet publications are available that provide everything a developer might need. Regardless of what the problem is, the solution can almost always be found within minutes. Source code can be provided with what is known as “XML comments”. Such comments can be used to create precise documentation for classes, methods, properties and all other language resources. When a project is created, it is possible to select whether the XML comments should be summarized and written to an XML file. This file can then be transformed into an appealing documentation using one of the many available tools.
Using the language and its many tools, frameworks and application server can involve a wide range of costs. In general, there is at least one free version of the necessary tools, environments and mechanisms available in each case. Of course, there are also paid solutions available commercially. Both versions are widely used. Ultimately, the available budget and the planned project will determine how much to invest, if at all. For development work using Java, there is a wide spectrum of possible choices and the required investment can range from zero to very large sums. A common “zero investment” approach involves a combination of the Eclipse development environment with a GlassFish or JBoss Application Server as well as free frameworks to simplify and accelerate the creation of applications. Examples are Hibernate for data persistency and JBoss Seam for high-grade support for web applications based on directly usable complete solutions for security and other non-functional requirements. For smooth development, there are graphical tools that fully integrate into the environment and support all of the available mechanisms. Here, JBoss is an important provider since the company offers a complete solution from A to Z that is free of charge. Another provider with a complete solution is IBM, although a large investment is required to purchase a comprehensive product due to the high license fees. On the other hand, appropriate support is available for the product range that is selected – a critical factor for many organisations. For development with .NET for Windows-based systems, Microsoft offers free express versions for a complete range of development work, and they can also be used at no cost for commercial applications. However, the functionality of these versions is limited and they do not permit incorporation of additional features into the environment. Microsoft offers multiple product versions that differ in terms of the functional scope. Of course, the more functions that are required, the higher the necessary investment. Accordingly, it is important to clarify in advance what functionality is actually required and incorporate this information into the cost calculations. Some free alternatives, especially for development with Mono, are SharpDevelop and MonoDevelop. However, they clearly lack the diverse functionality provided by Visual Studio. Accordingly, the cost savings are usually related solely to the development environment.
Comparison matrix of decision criteria
The decision as to which of the two technologies is right should be predicated on the functional scope only to a partial extent. In their current versions, both technologies rate equally highly. Moreover, one can assume that both will always have solutions to future problems since the two technologies are subject to continuous extension. The company and its employees pose more important criteria for successful projects. If the choice is not dictated by a company-wide strategy, the main focus should be directed towards the following questions:
- What initial and consequential costs can be expected for the planned project? Basically, it is not the license costs for the technology and the development environment that are the ultimate driver here. Instead, the costs that are incurred are influenced substantially by the level of familiarity of the employees along with the training that is required.
- How well does the technology integrate into the existing system landscape?
- To what extent are the employees already familiar with this or similar technologies?
- For which technology is it easier to find well qualified employees in the labour market?
- Will this technology, or parts thereof, continue to be developed in future?
- Can maintenance of the application also be guaranteed in future?
Both technologies are now fully developed, and in many cases the functionalities no longer form the basis for the choice. Each of these two technologies is undergoing continuous further development and integrates the best elements of the other technology. If the functional scope of the framework and a dynamic developer community are important, then Java is the better choice. This is due to the larger open source community that exists here and provides more advanced solutions. On the other hand, if a single-source package of fully integrated developer tools is important, then better results can be obtained with .NET with only a small investment. If integration into an existing system landscape plays a role, there is usually no other choice except to remain with the current technology or choose the technology that offers the best integration. However, if integration using communications mechanisms such as web services can be guaranteed, then other criteria should be weighted more heavily. If the existing developer team is more familiar with one or the other technology, then the obvious choice is to use the more familiar technology. This will accelerate development due to the shorter training period and framework functions that are already familiar. Creation of a project-specific criteria checklist provides the necessary requirements for the planned application. Here, it is important to weight the criteria and make a choice based on the given situation. The criteria that were discussed here should help to contrast the two technologies. You should choose the technology that appears more promising based on the criteria checklist. Nevertheless, we believe you can achieve good results with either of the two technologies!