This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
The Java2 Platform, Enterprise Edition (J2EE) provides a standard for developing multitier, enterprise services.
The economy and technology of today have intensified the need for faster, more efficient, and larger-scale information management solutions. The J2EE specification satisfies these challenges by providing a programming model that improves development productivity, standardizes the platform for hosting enterprise applications, and ensures portability of developed applications with an extensive test suite.
J2EE architecture supports component-based development of multi-tier enterprise applications. A J2EE application system typically includes the following tiers:
Client tier: In the client tier, Web components, such as Servlets and JavaServer Pages (JSPs), or standalone Java applications provide a dynamic interface to the middle tier.
Middle tier: In the server tier, or middle tier, enterprise beans and Web Services encapsulate reusable, distributable business logic for the application. These server-tier components are contained on a J2EE Application Server, which provides the platform for these components to perform actions and store data.
Enterprise data tier: In the data tier, the enterprise's data is stored and persisted, typically in a relational database.
J2EE applications are comprised of components, containers, and services. Components are application-level components. Web components, such as Servlets and JSPs, provide dynamic responses to requests from a Web page. EJB components contain server-side business logic for enterprise applications. Web and EJB component containers host services that support Web and EJB modules.
Figure 1: Overview of the J2EE Architecture
Figure 2: Overview of the .Net Framework
.Net Framework is the Microsoft's solutions for the enterprise ready architecture. .Net is equally famous as J2EE as a Enterprise Application Development Framework, and it is capable as well, Following Section will briefly describe the .Net Framework;
[2.]The foundation of the .NET Framework is the common language runtime. Its principal purpose is to load, execute, and manage code that has been compiled to Microsoft's new intermediate byte-code format called Intermediate Language (IL). Several languages, notably Microsoft's Visual Basic .NET and C# .NET (pronounced "C sharp"), have compilers supporting this format, and many more are currently in development. It is important to note that the IL code is not interpreted. The common language runtime uses just-in-time compilers to compile the IL code to native binary code before execution.
Other significant features of the common language runtime include the following:
â- Version control
â- Memory management
â- Cross-language integration
â- Common data type system
The next component or layer of the .NET Framework is the .NET Framework base classes. The purpose of this layer is to provide the services and object models for data access and manipulation, data streams (input/output [I/O]), security, thread management, and more. In many respects the Windows API (Application Programming Interface) has been abstracted into these base classes. These libraries are an object-oriented collection of classes that can be reused and enhanced to enable rapid application development. The classes support the creation of applications that range from ASP.NET Web pages and
Web Services to traditional Windows and command line applications. The .NET Framework also provides several runtime hosts, which are unmanaged components that load the common language runtime into their processes and initiate the execution of managed code, creating a software environment that can exploit both managed and unmanaged features. The .NET Framework software developer's kit (SDK) not only provides several runtime hosts but also supports the development of third-party runtime hosts.For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for managed code. ASP.NET works directly with the runtime to enable .aspx pages and Web services, both of which are discussed later in this section. The final layer of the .NET Framework consists of the user and program Interfaces. The two components of this layer are ASP.NET Application Services and Windows Application Services. The cornerstone of the ASP.NET Application Services is, of course, ASP.NET, which in turn supports the new Web services and Web Forms technologies that are discussed later. The Windows Application Services component supports traditional Windows programming applications through Windows Forms.
The following sections describe the main components of the .NET Framework
in more detail.
Features of the Common Language Runtime
The common language runtime provides an execution environment that manages
the set of code targeted to the .NET Framework. Code management can include memory management, thread management, security management, code verification, and compilation of the code. All managed components must first be assigned a level of trust. The level or degree of trust can vary on the basis of the following origins:
â- Local computer
â- Internet connection
â- Enterprise local area network (LAN) connection
After the component is assigned an appropriate level of trust, the managed component either can or cannot perform functions from within the application. In fact, based on the trust levels, a managed component may act differently within the same active application. The degree of trust can be used to limit registry access, file access, or network functionality. The common language runtime enforces security in a way that enables a client to run executables without endangering or risking inappropriate access to sensitive local resources or devices. For example, a user could double-click an executable in
an email, and although it may play a video or audio stream, access to personal data on the computer is not at risk. This enables an Internet application to be as feature-rich as normal desktop applications. The common language runtime also uses a common type system (CTS) to enforce code robustness and language interoperability. Various Microsoft and other third-party compilers can generate managed code that complies with the CTS. The purpose of the CTS is to enforce a strict data type and code verification
standard. Through the CTS, managed code can include managed classes, types, and other objects while enforcing type safety and conformity to the infrastructure. Another primary goal of the common language runtime is increased programmer efficiency. With all the .NET Framework languages complying with the common language runtime, the programmer can choose a language of preference. Each language can take full advantage of the common language runtime, the class library, and the components. This will make future programming available in whichever language is best suited to the developer
and application requirements while maintaining a high level of language
Interoperability and independence. The built-in automatic memory management also enhances application and infrastructure stability. This new feature-the garbage collector-eliminates
some of the most common application errors involving memory leaks and invalid memory references. It manages all references to objects and releases them when they are no longer in use. In a nutshell, the automatic memory management helps the application clean up after itself. The common language runtime also should increase application performance. This may be accomplished in two ways: just-in-time (JIT) compliers and server-side applications. The JIT compilers are used to compile all managed code to native machine binary code at execution. Server-side applications can house application logic and business rules on .NET Enterprise Servers such as Internet Information Server (IIS) and SQL Server. This allows the consolidation of application logic and business rules in a more maintainable environment and permits execution closer to dependent resources. For many applications this will result in not only reduced maintenance requirements but increased responsiveness.
.NET Framework Class Library
The .NET Framework class library is a collection of reusable classes, or types, that tightly integrate with the common language runtime. .NET applications benefit from using and extending or inheriting the functionality from the classes and types available in the class library. The class library is very hierarchical and well organized, as shown in Figure 1.2. It starts with the most generic classes and continues to build down to classes with very specific and precise functionality. Although this library is extensive, its organization makes it easy to learn and use. In an age of ever-growing technology it is refreshing to see a new technology and a new architecture that promise a reduced
learning curve. This model also makes it easy for third-party components to be integrated easily with the existing class library.
As expected in an object-oriented class library, the .NET Framework classes enable developers to accomplish rapidly a wide range of common programming tasks, including things such as string management, file access, and database connectivity. Also, several classes facilitate highly specialized and custom development environments. These classes make the application development environment very flexible. The following types of applications are readily supported through the .NET Framework:
â- ASP.NET applications
â- Console applications
â- Scripted applications
â- Windows applications (Windows Forms)
â- Web services
For example, the Windows Forms classes are used to create Windows graphical user interface (GUI) applications, which often are referred to as standalone applications. This is facilitated through a series of reusable graphical interface classes. Alternatively, in developing a Web-based application, the HTML and Web Forms classes facilitate its rapid development. Either way the underlying framework provides the flexibility for feature-rich applications regardless of the choice of application environment.
Client Application Development
Client applications represent the most common application environment in use today. These are the applications that one would invoke by opening some type of form and initiating an action. Examples of client applications range from word processing applications to a customized accounting package. One typically begins the application by opening a form from a desktop icon or the Windows Start menu. Client applications typically use the standard Windows features, such as dialogue boxes, menu items, and buttons. In most cases the files and executables for the application are stored and run locally and are interacted with by using local peripherals. The traditional Windows programming environment has been replaced in .NET by the Windows Forms control. The managed Windows Forms control allows the application to be deployed over the Internet, and the user can view the application as a Web page. In the past developers created such applications by using C or C++ in conjunction with the Microsoft Foundation Classes (MFC) or with a rapid application development (RAD) environment such as Microsoft Visual Basic. The .NET Framework incorporates aspects of the earlier products into a single, consistent development environment. The goal of the single environment is to simplify the development of client applications.
This simplicity can be further enhanced by incorporating the security and deployment features of the common language runtime. Because feature-rich applications can be deployed from the Web, many applications that once were installed on a user's system can now be Web-based. The application can define code-access security limits, which restrict what the application can do on an individual's machine. This gives the developer security features even though the application is running in the machine language. In fact, a single application can incorporate objects from multiple Web servers. Each object and
Web server may have security rights different from those of another server. All security rights are evaluated even though the objects are used within a single application. Windows Forms applications still have some advantages over Web-based applications. Windows Forms applications have a level of trust that is already assumed. This allows binary and natively executing code to interact with some of the resources on the local machine. This is used to perform the necessary GUI elements of the application.
Server Application Development
Web services are server-side application components that can be distributed easily in a similar fashion to Web sites. Web services components are not targeted for a specific browser and have no user interface. They are simply reusable software components designed to be used by other applications. Web-based applications, traditional applications, and even other Web services can use the Web services. The Web services are moving application development toward the Internet. All application development can now take advantage of the highly distributed world that previously was available only with Web-based applications. ASP.NET is the environment that enables developers to use the .NET Framework to target Web services applications. Both Web Forms and Web services use IIS as the publishing mechanism for applications, and both have a collection of supporting classes in the .NET Framework. If you are familiar with earlier versions of ASP technology, you will enjoy the new features of Web Forms. The most noticeable new feature is the ability to develop one's Web Forms in any language that supports the .NET Framework. You can use Visual Basic .NET to create your Web Forms if that is the language you prefer. You are not required to learn multiple languages to create different types of applications. Web Forms also can execute in the native machine language and take advantage of the common language runtime in the same manner as all other managed applications. This allows the Web Forms to be compiled and executed at a much faster rate. Users will notice that the ASP.NET pages are faster, more functional, and easier to create.
Figure 3: Spring Framework
Spring is an open source, lightweight, application framework that is intended to help structure entire applications in a consistent manner, pulling together best of breed single-tier frameworks in a coherent architecture.
Following section will describe each of the components listed above briefly:
â- Core package is the most fundamental part of the framework and provides the
Dependency Injection container
â- The basic concept here is the BeanFactory, which provides a sophisticated
Implementation of the factory pattern which removes the need for programmatic
singletons and allows you to decouple the configuration and specification of
dependencies from your actual program logic
â- The DAO package provides a JDBC-abstraction layer that removes the need to do tedious JDBC coding and parsing of database-vendor specific error codes.
â- The JDBC package provides a way to do programmatic as well as declarative transaction management, not only for classes implementing special interfaces, but for all your POJOs (plainold Java objects)
â- The ORM package provides integration layers for popular object-relational mapping APIs, including JPA, JDO, Hibernate, iBatis, and JPA.
â- Using the ORM package you can use all those O/R-mappers in combination with all the other features Spring offers, such as the simple declarative transaction management feature mentioned previously
â- Spring's AOP package provides an AOP Alliance-compliant aspect-oriented programming implementation allowing you to define, for example, method-interceptors and point cuts to cleanly decouple code implementing functionality that should logically speaking be separated.
â- Using source-level metadata functionality you can also incorporate all kinds of behavioral information into your code.
â- Spring's MVC package provides a Model-View-Controller (MVC) implementation for web applications
â- Spring's MVC framework is not just any old implementation; it provides a clean separation between domain model code and web forms, and allows you to use all the other features of the Spring Framework.
What is meant by Enterprise Application:
Enterprise can be simply defined as applications designed to solve problems encountered by large enterprises. These Applications usually handles complex business logic. Apart from that they usually have following attributes;
As mentioned above due to the complexity of the Business Logic been involved with Enterprise Applications, significant effort needs to be applied to develop this properly. This is where Frameworks such as .NET, J2EE and Spring comes in to the scene. These Frame works provides services to handle recurring issues in developing this sort of large scale applications.
Following Section Defines what is a Framework?
A framework is a set of code or libraries which provide functionality common to a whole class of applications. A web application framework may provide user session management, data storage, and a templating system. A desktop application framework may provide user interface functionality and widgets (common GUI elements).Framework includes physical components - usually files usable during production. Java and .NET frameworks are set of concrete components like jars, dlls, etc.
Framework alone will not work; the relevant application logic should be implemented and be deployed along with the framework.
Role of Frameworks in Enterprise Application Development:
When it comes to enterprise application development frameworks plays a major role. As Described in the above section frameworks allow the Enterprise Application Developers to focus more on the complex business logic rather than worrying about recurring issues like how to handle network communication, Database Connections, Security and Transaction management etc. Frameworks provide these services through their well define well tested class libraries. Since these solutions are built-in to the frameworks it increases the reliability and the stability of the application as well as it helps to reduce the amount of effort that needs to be put in to developing these applications, which is really important factor in Enterprise application Development since the time to market matters a lot for this sort of applications for the clients in order to get the competitive edge by using these applications.
Services provided by frameworks:
In Enterprise Application Development use of frameworks is quite eminent as described above, for this purpose there are several frameworks available in the industry, J2EE and Spring for java based solutions and .Net Framework for .Net based enterprise applications development. All of the above mentioned frameworks are now been well established in the industry and it is one of the main reasons that we need interoperability between several systems developed using different frameworks. All of the above framework's common focus is to free the developers from dealing with common recurring problems and allow them to focus more on the application/business logic. In order to achieve this all of the above frameworks provide set of services through their class libraries.
Following Section list down these services provided by frameworks:
Client Session Management
Handled by the framework
Figure 4: Services handled by the framework
In order to provide the above services different frame works provide different mechanisms. In J2EE framework it provide these services through set of services like;
In.NET these services are provided through set of services like;
Communication and Workflow.
In Spring These framework services are provided through:
Hibernate Version 2 and 3.
JDO version 1 and 2.
AOP method interceptors.
Integrated Development Environment is an important tool for developing any sort of application. This section will explain how using a particular IDE become important for enterprise application development process.
For the .Net environment the most famous IDE is the Visual Studio and for the J2EE architecture the most famous IDEs are Eclipse and Netbeans. These IDEs provide excellent support for exploiting the underlying framework. Following section will describe how these IDEs can improve the overall productivity of developing an Enterprise Application using a specific framework.
Customizing the text editor:
In Most of the IDEs the text editor where you actually type in your code can be customize to suit your organization standards and preferences. For an example you can set the font size, font type, indentation for a tab, Bracketing styles etc. Which is necessary for Distributed development environments where coding is done in several locations or may be several developers in the same place, in each of these scenarios your source code needs to look the same. Almost all IDEs like Visual Studio, Netbeans, Eclipse support above features.
In visual studio it provide the facility to use TODO tokens as way navigating to a location of the code that needs the attention of the developer later. By adding a TODO token developer can easily track these places using the tasks list option.
Apart from using TOKENS both netbeans and Visual Studio IDEs support the use of documentation comments that can be used inline with the code or describe the code and these documentation comments can be used to document the code automatically. In Netbeans it uses JavaDoc and in Visual Studio there are tools like Sand Castle to generate documentation about the code using documentation comments.
In both IDEs like Netbeans and Visual Studio it provide the support to refactor the code effectively, so that you can change parameter names, remove parameters, and reorder parameters used in methods of a class and make these changes affective to all the locations that these methods and parameters have been used in the project.
Organizing the Code:
In visual Studio it provide "#region, and #endregion" tags allows to organize the code segments which performs the related tasks, so that source code become more manageable and it also make the maintenance of the source code easy.
Apart from this feature visual studio provide elegant shortcuts like "Ctrl+E,D" to format the source code properly with proper alignment.
Code Completion Features:
Both IDEs Netbeans and Visual Studio provide automatic code completion features like intellisense, code snippets etc.
In intellisense it help the programs by suggesting the methods, variables that is available in the particular context that he /she is typing the code, this increase the efficiency of writing code as well as the developers doesn't need to remember everything that is available in the classes that they create or the classes available in the framework itself. Also it displays the documentation related to the suggestion that it made while typing the code.
Code Snippets are set of code blocks like the for loop, if condition which can be invoke directly by calling a shortcut key instead of typing whole code blocks.
For a example in Visual Studio if you want to invoke the code block for "For Loop" simply type for and press the "tab" key twice. In Netbeans type "for" and press "Ctrl+Space" this will generate the code snippet for the 'for loop'.
In both IDEs code generation feature is supported to reduce the time taken to type in recurring code blocks. For an example once you type in the attributes of a class you can generate the getters and setters for those attributes without typing them. In Net beans this code generation extends from generating getters and setters to generating configuration files, entire classes, mapping files from relational databases and so on. All these features help reduce the time taken to type the code.
Synchronizing with Code Repositories:
In actual development environment managing the versions of the code handled by several developers or several development teams in different geographical location is a routine tasks. IDEs like Net beans provide the facility to use a code repository and checkin ,checkout, update, and add operations from within the IDE without using a separate client for accessing the repository which is a quite handy feature to have to make the life easy for the developers.
Considering all these features it is evident that using a particular tool like IDE is very important in utilizing the power of underlying framework, since if it wasn't for these IDEs exploiting the full potential of each of these framework could have well been a hectic and a tedious task.