COMPARING - People



COMPARING .NET AND J2EE FRAMEWORKS

by

VENKATA KARTHIK PUTTAM REDDY

B.E., Madras University, Chennai, India, 2004

A REPORT

submitted in partial fulfillment of the requirements for the degree

MASTER OF SCIENCE

Department of Computing and Information Sciences

College of Engineering

KANSAS STATE UNIVERSITY

Manhattan, Kansas

2006

Approved by:

Major Professor

Dr. William Hankley

ABSTRACT

The primary objective of this Master's report is to analyze aspects of the architecture, design and implementation of applications in both the J2EE and .Net frameworks. The frameworks will be compared based on several criteria to be detailed in the following sections. The J2EE and .Net pet stores are also discussed as part of this comparison.

The .Net framework and an Oracle 10g database is used to build an application that provides users with greater flexibility and advanced features, a highly dynamic yet interactive user interface and a host of other enhancements that will greatly improve the user’s experience using such an application. The application is meant to serve as a practical example of all the issues discussed with reference to the .Net framework.

Given the plethora of business logic applications being built and deployed on both the J2EE and .Net frameworks, a comparison is necessary to determine what ultimately governs developers in their choice of platform. In most cases, the choice of technology is governed by the norms of the company developing the application and no conscious thought is given to which is the better platform. In the case of individual developers, several small yet highly significant factors such as ease of installation, learning curve, ease of deployment and so on also play a role in deciding which framework is used. Given the state of confusion and an abundance of supporters for both frameworks, a comparison between the two becomes paramount.

Table of Contents

Table of Contents iii

List of Figures v

List of Tables vi

Acknowledgements vii

1. Introduction 1

1.1 Objective 1

1.2 Motivation 1

1.3 Structure 1

2. Overview of J2EE and .Net 2

2.1 J2EE 2

2.2 .NET 3

3. Architectures of J2EE and .Net 3

3.1 J2EE Architecture 4

3.2 .Net Architecture 6

3.3 J2EE Application Architecture 7

3.4 .Net Application Architecture 8

4. Comparison between J2EE and .Net 10

4.1 HTML generation 10

4.2 Transactions 11

4.3 Calling remote objects 12

4.4 Data Access 12

4.5 Execution Engine 13

4.6 Cross-platform portability 13

4.7 Security 14

4.8 Language support 15

4.9 Tools support 15

4.10 Vendor support 16

5. J2EE and .Net Pet stores 16

5.1 Java Pet Store 18

5.2 .Net Pet Store 21

5.3 Pet store Statistics 23

6. FNP Proposal Application using .Net 25

6.1 System Architecture 25

6.2 Database Design 27

6.3 Control Flow 29

6.4 Functionalities 33

6.5 Improvements and Enhancements 34

6.6 Testing - ANTS Load Test 35

6.7 Screen Shots 38

7. Conclusion 41

References 42

Appendices 43

Appendix A – Technologies used to implement the project 43

Appendix B – Description of the modules used in the project 44

List of Figures

Figure 1: Overview of J2EE [1] 5

Figure 2: Overview of .Net [1] 7

Figure 3: Application Architecture using J2EE 8

Figure 4: Application Architecture using .Net 9

Figure 5: Use Case diagram for pet store application [3] 17

Figure 6: Java Pet Store 19

Figure 7: Functional modules of J2EE pet store [3] 20

Figure 8: .Net Pet Store 21

Figure 9: .Net architecture for Pet Store 22

Figure 10 : J2EE vs. .Net Pet store lines of code comparison [4] 23

Figure 11: .Net and J2EE pet stores response times’ chart [4] 24

Figure 12: System Architecture 25

Figure 13: Relationships between Tables in Database 27

Figure 14: Use Case Diagram for County Agent 30

Figure 15: Control Flow Diagram for County Agent 31

Figure 16: Class Diagram for County Agent 32

Figure 17: Control Flow Diagram for System Administrator 33

Figure 18: ANTS Load Test – 1 36

Figure 19: ANTS Load Test - 2 36

Figure 20: ANTS Load Test – 3 37

Figure 21: ANTS Load Test - 4 37

Figure 22: Default.aspx 38

Figure 23: Sabw_Add.aspx 38

Figure 24: View_Report.aspx 39

Figure 25: view.aspx 39

Figure 26: submit_program_description.aspx 40

Figure 27: view_sb_budget.aspx 40

List of Tables

Table 1: Analogies between J2EE and .Net 10

Table 2 : .Net and J2EE pet stores response time (in milliseconds) [4] 24

Table 3: Database Tables Description 29

Acknowledgements

I would like to thank my major professor, Dr. William Hankley for his guidance throughout the duration of this project.

I would also like to thank Dr. Daniel Andresen and Dr. Mitchell Neilsen for serving on my committee and providing me with valuable suggestions on my project.

I would further like to thank Dr. Torben Amtoft, for being present at the presentation of this project.

Introduction

1 Objective

The primary objective of this Master's report is to analyze aspects of the architecture, design and implementation of applications in both the J2EE and .Net frameworks. The frameworks will be compared based on several criteria to be detailed in the following sections. The J2EE and .Net pet stores are also discussed as part of this comparison.

The .Net framework and an Oracle 10g database is used to build an application that provides users with greater flexibility and advanced features, a highly dynamic yet interactive user interface and a host of other enhancements that will greatly improve the user’s experience using such an application. The application is meant to serve as a practical example of all the issues discussed with reference to the .Net framework.

2 Motivation

Given the plethora of business logic applications being built and deployed on both the J2EE and .Net frameworks, a comparison is necessary to determine what ultimately governs developers in their choice of platform. In most cases, the choice of technology is governed by the norms of the company developing the application and no conscious thought is given to which is the better platform. In the case of individual developers, several small yet highly significant factors such as ease of installation, learning curve, ease of deployment and so on also play a role in deciding which framework is used. Given the state of confusion and an abundance of supporters for both frameworks, a comparison between the two becomes paramount.

3 Structure

The report will be organized in the following manner; the basic overview of J2EE and .Net is first discussed as an introduction to the two frameworks. This is followed by a more detailed discussion of the architecture of the two frameworks with special focus on their components. The report then considers the several criteria and the differences in the frameworks in addressing those criteria. An approach to building a sample application in both frameworks is outlined followed by a discussion on the J2EE and .Net pet stores, which are existing sample applications and a major precursor to the J2EE vs. .Net debate. The report will then include a sample application designed and built using the .Net framework.

Overview of J2EE and .Net

1 J2EE

J2EE (Java 2 Platform, Enterprise Edition), refers to a group of specifications, frameworks, technologies, etc. which are used for building distributed enterprise systems and as such does not refer to any specific language. The Java platform can be classified into the following organizational structure

• The Java 2 Platform, Micro Edition (J2ME) which is used mostly in conjunction with lower-end devices such as handhelds.

• The Java 2 Platform, Standard Edition (J2SE) which is primarily aimed at use on desktop machines or laptops.

• The Java 2 Platform, Enterprise Edition (J2EE) which is of primary interest to this report and is used on servers.

J2EE comprises a number of programming and scripting languages including but not limited to Java, XML, JSP, HTML, and SQL amongst others. Some of the advantages of Java include cross-platform portability, availability of open-source libraries, a huge server-side deployment base, and coverage for most W3C standards.

2 .NET

.Net is a framework developed by Microsoft to help connect people, information, systems and devices across the globe through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services. Businesses using .Net are able to integrate their systems more rapidly and in an agile manner.

The .Net framework allows the use of several programming languages and libraries in what is essentially a development and execution environment that helps create web and windows based applications that are easy to build, manage, deploy and integrate with other networked systems. The framework consists of:

• The Common Language Runtime (CLR) which acts independently of any specific language and is used as a development environment to build various types of applications.

• The Framework Class Libraries (FCL) is the collective name for the numerous classes that comprise the .Net framework. It is used for runtime core functionality such as basic types and collections, interaction with databases, generating XML and so on.

Architectures of J2EE and .Net

The following section examines the architectures of the J2EE and .Net frameworks at both their system and the application architecture level. The first section examines the system level architecture and it is found that analogies can be drawn between the two frameworks based on their respective system architectures. The application architectures of both frameworks is then discussed and it is found that several analogies and differences between the frameworks exist which are detailed in the following section.

1 J2EE Architecture

• JavaServer Pages (JSPs): JavaServer Pages are used to generate dynamic content for web browsers similar to HTML.

• Servlets: Servlets are used in conjunction with JSP’s in order to build control and navigation logic into J2EE applications, while following a Model-View-Controller design pattern.

• Enterprise JavaBeans (EJBs): These form the mainstay of the J2EE platform and are mainly of two types – the session beans which are used to model business logic and the entity beans that model persistent data. EJBs provide transparent scaling, a security framework, a transaction model, and a container-managed life cycle.

• Java Connectivity Architecture (JCA): This allows Java enterprise applications to interface with existing non-Java enterprise applications such as SAP.

• Java Message Service (JMS): It is used to provide asynchronous messaging capabilities to the J2EE platform.

• Java Management Extensions (JMX): It is used in the management of J2EE servers and applications.

• Java Naming and Directory Interface (JNDI): An integral part of the J2EE platform, this provides component location transparency in a clustered J2EE environment.

Although the following components are technically part of J2SE, they prove important for J2EE applications as well:

• Java Database Connectivity (JDBC): This is used to handle all database input/output through SQL.

• The HotSpot Virtual Machine: It can be run in server mode to better profile long-running applications with stringent requirements for thread and memory management. The HotSpot VM has addressed most of the initial concerns about J2EE's performance.

[pic]

Figure 1: Overview of J2EE [1]

Normally, thin-client multi-tiered applications are hard to write because they involve many lines of intricate code to handle transaction and state management, multithreading, resource pooling, and other complex low-level details. The component-based and platform-independent J2EE architecture makes J2EE applications easy to write because business logic is organized into reusable components. In addition, the J2EE server provides underlying services in the form of a container, which is an interface between a component and the low-level platform-specific functionality that supports the component for every component type. Since these services do not have to be developed by the user, more focus is given to the application at hand. [2]

2 .Net Architecture

.NET developed by Microsoft, is a part of their web services strategy to provide massive interconnectivity between people, systems, information and also devices through the use of software.

.NET includes a host features deployed across the Microsoft platform such as servers that are used to host Web services, which are built by development tools and in turn applications that make use of these and a worldwide network of organizations to provide information and assistance to customers.

.NET applications have the ability to be quickly and securely built and the use of .NET technology provides the means for deployment and management of these applications with web services.

Smart client software: This includes software for running a variety of smart clients, from personal computers, to small-footprint devices like PDAs and set-top devices.

XML Web services: This allows applications to share data and consume services provided by other applications without regard to how those applications were built, what platform they run on, or what devices access them.

Enterprise servers: These are products that support enterprise applications by addressing different parts of the overall solution.

Development tools and the runtime environment: An integral part of this includes Visual Studio .Net, a single integrated development environment for building .Net applications, along with the .Net Framework, which in turn includes the Common Language Runtime (CLR), , which is a new Web development environment for building Web applications and XML Web services and an extensive set of framework class libraries. [2]

[pic]

Figure 2: Overview of .Net [1]

3 J2EE Application Architecture

The presentation layer can be built using JSPs and servlets which incorporate code along with HTML. The business logic is implemented by session beans which can either be stateless or stateful. The entity beans are then used to communicate with a relational database.

[pic]

Figure 3: Application Architecture using J2EE

4 .Net Application Architecture

The web forms and the code behind classes are the equivalent of the presentation layer in J2EE and are used to design the user interface. These communicate with the .Net managed classes that act as the business layer which in turn use to connect to the database server.

[pic]

Figure 4: Application Architecture using .Net

The above architectures of both frameworks share several analogies and difference which are detailed in the following section but is briefly illustrated by the following table:

|Feature |J2EE |.Net |

|Type of technology |Standard |Product |

|Middleware Vendors |Oracle, IBM, BEA Systems and many others |Microsoft |

|Web Pages and HTML |JSPs | |

|Middle-Tier Components |EJBs |.Net Managed Classes |

|Database Connectivity |JDBC | |

|Execution Engine |JVM (Java Virtual Machine) |CLR (Common Language Runtime) |

|Portability |Variety of operating systems |Windows |

|Interpreter |JRE |CLR |

|Language Support |Java |Multiple Languages |

|Tools Support |Eclipse, JBuilder |Visual |

Table 1: Analogies between J2EE and .Net

Comparison between J2EE and .Net

1 HTML generation

• J2EE: HTML for J2EE applications is generated by JSPs and servlets whose containers include such features as session state, a security framework, and configuration. Tag libraries allow the developer to cleanly separate presentation code from control and business logic and also make the JSPs readable to HTML coders. The use of JavaServer Faces aims to extend JSPs to allow developers to specify user interface components, event handling for HTML widgets, data validation, and navigation, which are currently handled by presentation frameworks such as Struts.

• .Net: In this case web applications are built and hosted by under Microsoft's Internet Information Server (IIS). includes fault-tolerant session state, authentication and authorization, and HTML generation. With , developers build ASPX pages that include HTML and custom tags that map to server-side Web controls. The use of web controls provides reusable user interface logic and many advanced features to ease web programming.

Both J2EE and .Net provide great enhancements in developing web applications as opposed to the previous use of classic ASP or JSP where code was mixed with HTML. The use of and JSF is component based and event driven where application events are generated by components on a form in response to a user action.

2 Transactions

Transactions are a means for developers to provide systems with atomicity, consistency, isolation, and durability, which ensures that the system's data is coherent in case of error.

• J2EE: There is a choice for developers to either explicitly code transaction management that is user defined or manual, else specify the required behavior and hand off the management to the container.

• .Net: Here too, the CLR supports both manual and automatic transactions. With manual transactions, developers begin the transaction, enlist others in the transaction, commit or abort the transaction, and end the transaction. In automatic transactions, developers define an object's transactional behavior by setting a transaction attribute value on an page, an XML Web service method, or a class. Once an object is marked to participate in a transaction, it will automatically execute within the transaction's scope.

Both frameworks support manual and automated transactions, where J2EE uses containers to handle transactions while .Net uses the Common Language Runtime for this.

3 Calling remote objects

• J2EE: Location transparency is a core J2EE feature. JNDI finds server-side components such as EJBs or JMS Queues, which, if running in a clustered environment, may or may not reside in the same VM. In practical terms, most application servers attempt to keep communicating EJBs in the same VM to minimize network traffic and the associated marshaling overhead. The developer can enforce in-VM execution with local interfaces.

• .Net: With .Net remoting, developers can call remote objects distributed across application domains, processes, and machine boundaries. This hides the remote call details, and it formats messages and provides the underlying transport mechanisms.

The frameworks support remote calling of objects where location transparency has been a long standing feature of J2EE and .Net remoting is the .Net framework’s approach to calling remote objects.

4 Data Access

All business logic applications revolve around their data, often stored in multiple, heterogeneous data stores. Both technologies provide data access and persistence strategies:

• J2EE: Two main types of entity beans are used to model persistent data which are container-managed and bean-managed. Both allow developers to use container-provided services such as transaction management, a persistence framework with intelligent database updates and caching, and a security framework, as well as scalability and fault tolerance.

• .Net: A variety of data sources can be accessed by developers through .Net's classes, including XML. includes data providers that let you connect to a database and executes commands. Developers can also transport data over the Web using XML Web services or across process boundaries using .Net remoting.

Data access is an important part of any application and both frameworks are well suited to handle data spread across multiple, heterogeneous sources. This is achieved by entity beans in J2EE and in the .Net framework.

5 Execution Engine

• J2EE: Java source code compiles into machine-independent byte code, which the JVM interprets at runtime. As a result, the particular installed JVM proves crucial to performance and scalability. As its name suggests, HotSpot looks for repeatedly executed code sections, then intensively optimizes them. In addition to great scalability and performance; it also supplies the standard configurable security model for code loading and execution. Also, Java's JVMs make use of their host machines' strengths. For example, JVMs optimized for Solaris will take advantage of that operating system's special features, such as thread management.

• .Net: The CLR environment executes .Net's Microsoft Intermediate Language code. Like the JVM, the CLR also offers support services, such as code verification, memory management via garbage collection, and code security. Microsoft designed the CLR to support multiple languages, whereas the JVM supports only one. Second, in .Net, managed code always translates into native machine code rather than interpreted. The CLR supports compilation from the start, unlike the JVM, which was originally designed as an interpreter.

The J2EE execution engine is primarily the JVM, which is comparable to the CLR in the .Net framework. While both of these provide similar features, a major advantage of the .Net CLR is the ability to support multiple languages.

6 Cross-platform portability

• J2EE: J2EE offers complete cross-platform portability. If a JDK exists for your target platform, then J2EE can run on it. The ability to support Windows and mainframes and everything in between represents a big J2EE attraction.

• .Net: .Net only supports the Windows platform, but in theory, other platforms could have also been supported, which is area of ongoing research.

This is an area where J2EE is vastly more flexible as it can be run on any machine containing a JDK as opposed to .Net which is currently only supported by the Windows platform.

However, cross-platform portability in the .Net framework is an area of ongoing research, such as the Mono project sponsored by Novell, which provides the necessary software to develop and run .NET client and server applications on a variety of platforms including Linux, Solaris,Mac OS X and Unix [12]. The Mono open source project consists of the the core components which include C# compiler, the virtual machine and the base class libraries, the Mono development stack which provides tools for application development and the microsoft compatibility stack which provides a pathway for porting Windows .Net applications to Linux.

7 Security

• J2EE: The J2EE security architecture is defined as part of the platform specification document. It details security management roles, and specifies goals of the security architecture, but does not specify security policy or implementation details (such as the use of a particular security technology to meet the described goals). [6]

• .Net: The CLR and base classes are responsible in large part for security functions within the .Net framework. The CLR uses a number of criteria to determine the security permissions of code to be executed, and obtains some security information from XML configuration files. The base classes control access to resources such as the file system by determining the permissions of the caller. [6]

Both sides agree they're roughly equal when it comes to user authentication and authorization. Microsoft claims superiority in its support for Web services and its ability to fine-tune exactly which resources a piece of code can access. Sun claims stricter support for standards and the fact that applications written in Java have been hit by fewer viruses and other attacks than Windows platforms.

8 Language support

• J2EE: This is in direct contrast to the previous criteria. Currently, only Java is supported. In order to use another language, an interface technology like the Java Native Interface (JNI) or web services need to be used.

• .Net: A major attraction of .Net is that it is language independent and can use any language once a mapping exists from that language to IL. This provides companies with more options, allowing them to choose the best language for the job based their developers' skills.

Here, the .Net framework enjoys vast superiority over J2EE as multiple language support is one of the key features of .Net. The J2EE platform however, supports only Java.

9 Tools support

• J2EE: Java features a plethora of tools, which is both good and bad: the developer has a great deal of choice, but might have difficulty choosing the right tool for a given job, such as choosing the best working IDE from numerous options. Support for debugging is good via the Java Platform Debugging Architecture (JPDA), and the arrival of Ant and JUnit has given the Java community a standard build tool and unit testing framework, respectively.

• .Net: Microsoft's long and successful development tools history continues with Visual Studio .Net, the single IDE for building .Net applications, such as Windows applications, Web applications, or XML Web services. With Visual Studio .Net, you can choose any .Net language. From the developer's viewpoint, applications are built using a single IDE. Visual Studio.

Both frameworks enjoy the support of a long and varied list of tools, used for designing, implementing and testing applications built in either of the frameworks.

10 Vendor support

• J2EE: Vendor support represents one of the major strongholds of J2EE. A wide variety of vendors offer numerous J2EE products.

• .Net: Currently, .Net is a Microsoft platform, which allows developers to remain unconcerned about an array of choices, about inconsistencies in various vendor implementations, or about standards compliance. However, the tie in to Microsoft might also be an issue for some vendors.

Vendor support for J2EE is strong and many frontline companies have pledged support for J2EE. However, given Microsoft’s dominance in software development, there is no dearth of takers for the .Net platform as well.

J2EE and .Net Pet stores

The Java Pet Store is Sun Micro System’s example web application in the J2EE blueprint series that was designed to document the best practices, design patterns, and architectural ideas for J2EE applications. This same application, called the .NET Pet Store has been implemented using C# and .NET.

The .Net pet store was built to compete with the J2EE version and made strong claims for the advantages of .Net in terms of superiority over J2EE in all measures of performance metrics, requiring just one-third the lines of code (LOC’s) and providing 28 times faster average response times, one-sixth the CPU utilization, and better scalability as the number of users increased. There is an additional claim that the architecture of the .NET version is also superior.

These claims were of course refuted by Sun Microsystems, which lead to the pet store war where both platforms released subsequent versions of the pet store in an effort to prove that their technology was superior to the other. To analyze and test each of the claims made by either side will be too large for the scope of this project, but all of the criteria discussed above form the basis for the J2EE vs. .Net pet store comparison, in addition to other performance metrics such as lines of code, response times, scalability, ease of deployment and so on. As of today, no convincing conclusion has been drawn and the debate continues.

[pic]

Figure 5: Use Case diagram for pet store application [3]

1 Java Pet Store

The original intent in developing the .NET Pet Store application was to use Sun’s primary J2EE blueprint application, the Sun Java Pet Store, and implement the same application functionality with Microsoft .NET . This will allow customers to compare the two technologies in several performance issues and recommended design patterns.

The original Java Pet Store application was built to provide a working model of various J2EE components integrated together and also to demonstrate how different J2EE technologies could be used. The Java Pet Store Demo consists of full source code for the Enterprise Java Beans (EJB) architecture, Java Server Pages (JSP) technology, tag libraries, and servlets that build the application. In addition, the Java Pet Store blueprint application demonstrates certain models and design patterns through specific examples. The full Java Pet Store contains three sample applications:

• Java Pet Store: The main J2EE Blueprints application.

• Java Pet Store Administrator: The administrator module for the Java Pet Store.

• Blueprints Mailer: A mini-application that presents some of the J2EE Blueprints design guidelines in a smaller package.

The Java Pet Store is an example e-commerce application where customers can buy pets in various categories online. This also includes the ability to search and browse for products ranging from dogs to reptiles. A website is used as an interface to present the application to customers. [4]

[pic]

Figure 6: Java Pet Store

A typical session using the Java Pet Store would be:

Homepage - This is the main page that loads when the user first starts the application.

Category View - There are five top-level categories: Fish, Dogs, Reptiles, Cats, and Birds. Each category has several products associated to it. If we select Fish as the category, we might see "Angelfish" etc.

Products - If you now select a product the application will display all variants of the product. Typically the product variant is either male or female.

Product Details - Each product variant (represented as items) will have a detailed view that displays the product description, a product image, price, and the quantity in stock.

Shopping Cart - This allows the user to manipulate the shopping cart (add, remove, and update line items).

Checkout - The checkout page displays the shopping cart in a read-only view.

Login Redirect - When the user selects "Continue" on the checkout page, they are redirected to login page if they have not signed in yet.

Verify Sign In - After being authenticated onto the site, the user is then redirected to the credit card and billing address form.

Confirm Order - The billing and the shipping addresses are displayed.

Commit Order - This is the final step in the order-processing pipeline. The order is now committed to the database at this point. [4]

[pic]

Figure 7: Functional modules of J2EE pet store [3]

2 .Net Pet Store

The .NET Pet Store focuses solely on the Java Pet Store component and does not implement either the administration or the mailer component. In addition, to retaining the functionality of the Java Pet Store, further objectives were added

• Compare and contrast the code and code size of a real world, best-practice application between .NET and J2EE.

• Provide data on how many users a typical, well-designed application can support when implemented in .NET and in J2EE.

The .NET Pet Shop application is now in its third revision and is designed to show the .NET best practices for building enterprise n-tier applications which may need to support a variety of database platforms and deployment models.

[pic]

Figure 8: .Net Pet Store

The application makes use of web forms for the presentation tier which communicates to C# business components in a logical middle tier. In turn the business components access a back end database through . Data Access is fully abstracted into a Data Access Layer separate from the business logic layer.

[pic]

Figure 9: .Net architecture for Pet Store

The following are the business requirements for the .Net pet store:

• The application should enable customers to browse the company catalog by category and through key word searches.

• The application should provide customers with a mechanism to purchase multiple items through a shopping cart model.

• The application should provide a simple security model so that a customer is required to sign in before they are allowed to purchase the contents of the cart.

• With large Enterprise System it is likely that the application will be required to access multiple data repositories, hence the application should support distributed transactions.

• The application should allow for a flexible deployment strategy. By default the application is designed to be deployed to two physical machines, one application server and one database server but should be extensible to work in other deployment models.

• The application should be easy to maintain, which will be measured by the lines of code in the application.[4]

4 Pet store Statistics

The comparison between the two pet stores based on Lines of code is outlined in the table below. It shows a clear advantage using the .Net framework in terms of code that needs to be written, subsequently tested and changed. There is a further argument based on these results that the Java code has to manually update pages using its Model View Controller design pattern as opposed to the .NET code that uses data binding with Server Controls like the DataGrid.

The test results below included only those lines of code considered important and excluded blank lines, comments and other insignificant code elements. Also, the comparison was based on the same functionality implemented in the .Net version as the J2EE one. In addition to this another test was carried out by VeriTest, an independent software tester, which found significant improvement in the .Net response times of more than 10 times faster response when considering a non-cached scenario with 5,000 concurrent users.

[pic]

Figure 10 : J2EE vs. .Net Pet store lines of code comparison [4]

[pic]

Table 2 : .Net and J2EE pet stores response time (in milliseconds) [4]

[pic]

Figure 11: .Net and J2EE pet stores response times’ chart [4]

FNP Proposal Application using .Net

This project is primarily concerned with adding a new module (Food and Nutrition Program Proposal Application) to the existing FNP website. The new module, in addition to requiring the aforementioned features, also needs to preserve the fast load times and speed of processing available on the FNP website.

1 System Architecture

Figure 12: System Architecture

Prior to this application, agents were required to file all of their information manually on paper and subsequently submit their proposals. This resulted in a large number of man-hours wasted, not only in the data entry process but also in verifying if all of the information was entered as per accepted procedures and formats and also the veracity of the data itself.

This data was then again manually entered into MS Excel spreadsheets into order to obtain analytical results from the data and perform calculations on the data.

To overcome these problems, the new Food and Nutrition Program Proposal Application Module needs to be built using a platform that supports all of the above requirements.

Several special features are also to be added to download the data in the form of reports directly into an Excel sheet. Users should be able to directly view reports created by performing calculations on the entered data.

The user interface of the website needs to be highly intuitive and conform to the required data structures and formats. The user should now able to enter all of the required proposal application information quickly and easily.

Technologies

For a detailed description of the technologies used to implement this project refer to Appendix A.

2 Database Design

[pic]

Figure 13: Relationships between Tables in Database

The following is the overview of the database design for this application.

|TABLE NAME |DESCRIPTION |

|SB_DATA |Contains all the primary information about a worksheet. |

|SB_DATA_ITEMS |Contains the amounts in dollars of the contractual services, supplies and|

| |in-state travel pertaining to the Collaborating Agencies, County Match |

| |and FNP Funds. |

|SB_MISC_DESC |Contains the textual description of each of the items in the |

| |sb_data_items table. |

|SB_COLLAB_AGENCY |Contains information about the descriptions of the Collaborating agencies|

| |and the amounts in dollars each agency has been pledged. |

|SB_EMP_PERSONAL_PLEDGES |Contains the salaries and benefits information about each agent and the |

| |positions they hold. |

|SB_PROPOSED_EQUIPMENT |Contains a list of all the proposed equipment, their descriptions and the|

| |associated costs. |

|SB_PROGRAM_DESCRIPTION |Contains primary information about each program description by curriculum|

| |associated with each worksheet. |

|SB_PROGRAMDESC_AGENCY |Contains information about the partnering agencies in a program |

| |description by curriculum. |

|SB_PROGRAMDESC_EXTENSION |Contains information about the agents and their contributions in a |

| |program description by curriculum. |

|SB_PROGRAMDESC_ITEMS |Contains information about the behavioral objectives and indirect |

| |contacts in a program description by curriculum. |

|USER_COUNTIES |Contains information about the user and his/her counties. |

|PAS_ITEMS |Contains textual descriptions of the items used in the program |

| |description by curriculum. |

Table 3: Database Tables Description

3 Control Flow

a. County Agent:

The county agents are required to logon using their user name and password. In the case of an incorrect login they are redirected to the same page and prompted to reenter the information.

In order to provide additional security and preserve the integrity of the data, each agent is allowed to view information only for his/her county. Further, if the user is not an agent of that county but some other employee such as a program or nutrition assistant, then he/she will be unable to access any sensitive information such as the salaries and benefits or other financial information.

After completing the data entry, the agent adds that worksheet to his county alone. This prevents agents from other counties viewing information about counties other than their own or making any changes to other counties’ information. The user can log off the system after completion of all tasks thereby terminating that session.

The following figures show the control flow of the project in greater detail.

[pic]

Figure 14: Use Case Diagram for County Agent

Figure 15: Control Flow Diagram for County Agent

[pic]

Figure 16: Class Diagram for County Agent

b. System Administrator :

Figure 17: Control Flow Diagram for System Administrator

The control flow for an administrator is different as he is able to view the information for all the counties and can perform various functions from the “Welcome” page. The administrator needs to log onto the system using a password authentication system similar to the county agents.

4 Functionalities

For a detailed description of the various modules this project has been divided into, refer to Appendix B.

5 Improvements and Enhancements

a) Speed:

One of the major enhancements to this module is the increased speed. As the tests will later demonstrate, the speed of the website is exceedingly fast in terms of connectivity and data entry. The layout of the application sheet and the user interface ensure that data can be quickly and accurately entered. The use of appropriate constraint checking both in Oracle and has also added to the speed of the application. The extensive use of Oracle Packages and Stored Procedures in this project has greatly reduced code in the implementation and ensures that data is returned from the Oracle database itself rather than using embedded sol queries in , which has further improved speed.

b) Reduction in Lines of Code:

The use of has also lead to a reduction in the number of lines of code needed to implement all the modules of this project. The use of user controls rather than individual web forms for each page has helped in both reusability of code and reduction in size. This helps the application to load faster which is further enhanced by the use of dynamic placeholders are used to load only the required controls rather than every single element on a page.

c) Improved User Navigation:

The user interface makes navigation between sections of the worksheet very simple and intuitive. Also, the elements on each page allow for many editing functions to be carried out which is also greatly beneficial to the users.

d) Storage of View State in State Server:

The view state is used by the server controls to manage their state across individual web requests. In this application the view state of the page is stored in the state server thereby causing the pages to load faster and simultaneously reducing their size.

e) Cascading Style Sheets:

Style Sheets have been extensively used in this project. Cascading style sheets reduce defining properties for each HTML element and have also been implemented to include a number of print and screen functions.

6 Testing - ANTS Load Test

The Advanced .NET Testing System (ANTS) is a tool used for load and scalability testing of .NET applications and other web services.

It provides highly useful information to predict a web application’s behavior and performance and works on all .NET applications. It has the advantage of being able to auto-generate testing scripts and also test XML web services.

The results of this test include information about the fastest and the slowest objects in the web application along with the fastest and slowest web pages in the application, in terms of load times and stress handling.

This helps to eliminate the slowest unnecessary objects in the web application and increase the speed of the slowest web pages in the application.

[pic]

Figure 18: ANTS Load Test – 1

[pic]

Figure 19: ANTS Load Test - 2

[pic]

Figure 20: ANTS Load Test – 3

[pic]

Figure 21: ANTS Load Test - 4

7 Screen Shots

[pic]

Figure 22: Default.aspx

[pic]

Figure 23: Sabw_Add.aspx

[pic]

Figure 24: View_Report.aspx

[pic]

Figure 25: view.aspx

[pic]

Figure 26: submit_program_description.aspx

[pic]

Figure 27: view_sb_budget.aspx

Conclusion

This report has compared the .Net and J2EE frameworks and provided me with a concise understanding of the two technologies. Given the features and capabilities of each framework, it is not possible to conclude that one framework is better than the other. Rather, the most obvious conclusion is that both frameworks will enjoy widespread use and with the advent of interoperability, it will be possible to get the best of both these frameworks.

Also, as part of the report, a comparison between the .Net and J2EE pet stores which has been an area of debate, was drawn. Although the results of published tests seem to indicate that the .Net framework achieved better results, given that benchmarks are considered unreliable because they are based on a specific set of rules, no conclusion can be drawn from these tests.

Another important conclusion can be drawn from the design approaches to building an application in the frameworks. The .Net approach constructs a model based on the database schema and is driven mostly by the database implementation. The J2EE framework, on the other hand focuses more intensely on an object model, as demonstrated by the J2EE pet store and all designs are influenced by the J2EE design patterns.

Also, a sample project was implemented in .Net, which provides users with a dynamic and flexible interface and furthers my understanding of the .Net framework.

References

[1] Chad Vawter, Ed Roman (June 2001). “J2EE vs. Microsoft .Net”, ()

[2] Humphrey Sheil, Michael Monteiro (4,500 words; July 26, 2002). “Comparing J2EE and .Net”, ()

[3] J2EE Design Patterns ()

[4] .Net and J2EE Pet stores ()

[5] Overview ()

[6]Ger Mulcahy (10 Pages, February 2002). “J2EE and .NET Security”, ()

[7] Scott Urman. (1997). “Oracle 8 PL/SQL Programming”, Osborne McGraw-Hill

[8] Oracle 10 g Overview ()

[9] Nikhil Kothari and Vandana Datye. (2002). “ Server Controls and Components”, Microsoft.

[10] ANTS load ()

[11] Dave Sussman, Alex Homer, Rob Howard, Karli Watson, Brian Francis, Richard Anderson. (2001). “Professional ”, Apress.

[12] Wikipedia. “Mono Development Platform”, ()

Appendices

Appendix A – Technologies used to implement the project

a) Microsoft Visual Studio .NET

The .NET framework forms the basic infrastructure for the new Microsoft .NET platform. It is a widely used and common environment for building, deploying, and running web services and web applications. It contains several class libraries, such as , and Windows Forms, to provide advanced standard services that can be integrated into a variety of computer systems.

Another feature is that it is language-neutral and supports C++, C#, Visual Basic, JScript, and COBOL, providing unprecedented flexibility in the choice of language. A host of third-party languages are currently available and the list is steadily increasing for building future .NET framework applications.

The new Visual is a common development environment for the new .NET framework. It provides a feature-rich application execution environment, simplified development, and easy integration between several different development languages.

b) Oracle 10g

The database server for this application is Oracle 10g. It is primarily aimed at reducing costs and improving the quality of service by making the database easier to deploy and manage. It also includes advanced capabilities for backup and recovery and supports enhancements for data warehousing.

It is robust and web-enabled. It offers easier fine tuning to serve the required purpose. It provides the most powerful database for secure, reliable, high-capacity Internet applications, data warehouses and e-commerce websites.

It is highly scalable. It scales to support the most demanding, high-throughput applications. It reduces the complexity of administration. It can manage the multimedia content directly. It provides complete data protection by means of Oracle Data Guard.

c) Microsoft Excel

Microsoft Excel is used to download all of the data in the form of reports. The choice of Excel for this purpose is justified owing to its powerful spreadsheet capabilities that allow the creation, storage, manipulation, analysis, and visualization of data. The application makes use of several formulas and calculations that are easy to implement using Excel.

Appendix B – Description of the modules used in the project

1. Welcome Page:

This module forms the primary user interface for the application and allows the user to navigate to different parts of the application in addition to each of the individual worksheets. The user is also able to add new worksheets, edit or delete existing worksheets, and also view summaries of the existing worksheets in the form of reports. The user is also able to select the worksheets pertaining to a fiscal year from this page.

2. Proposal Application Sheet:

In this module, the user can add or edit information to a proposal application sheet by accessing it from the main page. The proposal application sheet has several fields that need to be completed. They include:

General Information:

The user provides relevant and identifying information for the worksheet such as title of the sheet, fiscal year and the county for which the application is being submitted. In addition to these, the date of activity and user name of the person who entering information is appended to the welcome page.

Position:

This is an important section of the worksheet where details of each individual in that county are entered. Information provided for each individual include their FTE status, number of hours and weeks of employment, wages information and their job description. The user is also able to delete or make changes to existing information about individuals in that county, in this section.

Justification Salaries & Benefits:

The user enters a textual description of the justification of the salaries and benefits entered in the previous section.

Contractual Services:

The user enters the amounts in dollars of the various contractual services items. Here, there are two columns, one corresponding to the contractual services for FNP Funds and the other for the County Match.

Justification Contractual Services:

The user enters a textual description of the justification of the contractual services entered in the previous section.

In-State Travel:

The user enters the amounts in dollars of the various in-state travel expenses. Here, there are two columns, one corresponding to the in-state travel for FNP Funds and the other for the County Match.

Justification In-State Travel:

The user enters a textual description of the justification of the in-state travel entered in the previous section.

Supplies:

The user enters the amounts in dollars of the various supplies items. Here, there are two columns, one corresponding to the supplies for FNP Funds and the other for the County Match.

Justification Supplies:

The user enters a textual description of the justification of the supplies entered in the previous section.

Proposed Equipment:

Here, the user enters a list of all the equipment, their cost and the justification for that equipment. The user can also change or delete information about the equipment. Another constraint in this section is that the total cost of all the equipment should be equal to the amount of last item under supplies. If these two totals do not match, then the user is prompted by an error message to make the necessary changes, failing which he/she will be unable to continue to the next section.

Volunteer Pledges Match:

The user enters the volunteer pledges match and the cash donations for that county in this section.

Collaborating Agencies In-Kind Resources:

The user enters the name of each agency and its salaries and benefits. He can also enter the amounts of the contractual services and supplies for the collaborating agency. He can also update or delete any of the existing collaborating agency records for that county.

Program Description (By Curriculum):

The user can enter information for the various program descriptions which are described in detail in a later section.

Menu:

This is not a data entry section on the worksheet but allows the user with great flexibility in navigating between the different sections of the worksheet. Also, the menu keeps track of all completed sections of the worksheet, helping users to ensure that all sections of the worksheet have been completed.

The following are a series of reports that are generated for each worksheet and can be viewed and printed off by the user:

View Report:

The user can view all of the information pertaining to a worksheet in a summarized format.

View Extension of Pledged In-Kind Resources:

This provides a report of all the county employees and their associated information.

View Budget:

This provides a report of all the salaries and benefits, contractual services, in-state travel and supplies information for FNP Funds, County Match for that worksheet.

View Budget Narrative:

This provides a report of all the justifications for salaries and benefits, contractual services, in-state travel and supplies for that worksheet.

View Proposed Equipment:

This provides a report of all the information related to the equipment, its cost and justification for that worksheet.

3. Program Description (By Curriculum):

The program description forms a part of the main worksheet but has several fields that require completion and is treated as a separate module:

Target Audience:

The user can select multiple target audience for the program description.

Primary Topic:

The user can select a primary topic for the program description.

Behavioral Objectives:

The user can select multiple behavioral objectives for the program description.

Type of Contact:

The type of contact can either be direct or indirect. For direct contacts the user selects whether the lessons are one-on-one or by group, in addition to providing information about the number and length of the lessons. For indirect contacts, the user can select multiple values.

Curriculum Information:

The user selects either a adult or youth primary curriculum. If other primary curriculum is selected, the user is required to manually enter the description of the curriculum.

Extension:

The user selects the extension information for the different agents including their contribution to FNP. The user is also able to edit or delete existing extension information. Also, based on the county, a list of all the agents of that county are made available to the user, thereby making manual entry of names unnecessary.

Partnering Agency (Matching/Non-Matching):

The user provides information about the various matching and non-matching organizations. The user is also able to edit or delete existing agency information.

Summary:

The user provides a summary description of the program description by curriculum’s intent and the manner in which the program will be carried out.

4. Reporting Site:

This module of the application allows users to download all of the information into Excel sheets. This enables the creation of reports from the data entered on the worksheets which can also alternatively be viewed on the web page itself. There are a number of reports in this module, totaling around twenty-five in number. Each of these reports makes use of a different calculation and a different set of parameters to extract the required data.

-----------------------

County Agent

Admin

Front End

(HTML and c#)

Middleware

(.NET Framework)

Back End

(Oracle 10g)

Manage Agent

session

Add, Edit, Update, Print FNP Proposal Application

Manage Admin session

Perform Admin activities

Database

Index Page

Check Login Information

Agent Welcome Page

* Add FNP Proposal Application

* View and Print FNP Proposal Application

Edit FNP Proposal Application

Add/Update Information

Incorrect Login

Check Login

Welcome Page

* Add/Edit FNP Proposal Applications

*Perform

Report

Add/Edit

Counties

Save item

Information

Save county

Information

Index Page

Incorrect Login

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download