Using Microsoft .NET to implement Sun Microsystem's Javatm PET Store J2ETM Blueprint Application
10, 2001
content
Summary The necessary code line comparison performance and scalability comparison The necessary CPU% resource comparison introduction Functional MICROSOFT .NET PET SHOP This application architecture database intermediate layer ASP.NET Output Cache security comparison code size whose size. NET code Base is so small and efficient and higher performance and scalability comparison new features XML Web Service Mobile device support conclusions Appendix 1: Computing Code row
For the copyright and legal information about the Java PET Store, please refer to the last page of this article.
Summary
The purpose of this study is to understand Sun's J2EE Blueprint Application - SUN Java PET Store, and uses Microsoft .NET implementation with the same features. According to the J2EE of this Sun, the best sample application is implemented. The consumer can directly compare Microsoft .NET and J2EE-based application servers from multiple sides. In addition, the study compares the architecture and programming model of each platform, thereby estimating relative developer productivity. Among them, the object, file, and the number of applications that implement the same functionality of the same function through the three-layer structure on each platform are compared. The study also shows that the .NET PET SHOP application can be easily extended to support XML Web Service (Based on SOAP and UDDI standards) and mobile devices. To get a full source code based on .NET implementation, please visit http://www.gotdotnet.com/compare. The source code for the Java PET Store app is open to the Java 2 Platform Enterprise Edition Blueprint Web Site http://java.sun.com/j2ee/blueprints/index.html is open. The required code line number is compared (the code count is configured to implement the exact same application function on each platform. Please refer to the full detail information about the accurate code count, please refer to the appendix 1.)
Performance and scalability comparison based on Oracle-based Oracle issued by Oracle 9i Application Server For full adjustment and optimization of Java PET Store released. See Microsoft® .NET VS. Sun? Microstem's J2EE: Performance and Scalability of Performance and Scalability.
The necessary CPU% resource is based on the Benchmark data released by the Oracle of the Java PET Store as part of the Oracle 9i application server challenges. See Microsoft® .NET VS. Sun? Microstem's J2EE: Performance and Scalability of Performance and Scalability. Introduction Java PET Store is a reference implementation of a distributed application in accordance with a J2EE blueprint maintained by Sun Microsystem. This sample application is now released 1.1.2, which is created to help developers and designers understand how to use J2EE technology, and how J2EE platform components work together. Java PET Store Blueprint includes documentation, a complete source code for Enterprise Java Beanstm (EJB) architecture, Java Server Pages (JSP) technology, label library, and servlets that create applications. In addition, through a specific example, the Java PET Store blueprint demonstrates certain models and design models. For J2EE, Java PET Store is the best reference application, and is then distributed in J2EE-based application server products:
• IBM? WebSphere? 4.0? Bea? WebLogic? 6.1? Oracle? 9i application server? Sun microsystems iplanet? Fully Java PET Store contains three sample applications:
1. Java PET Store: The main J2EE blueprint application. 2. Java PET Store Administrator: The administrator module of the Java Pet Store. 3. BluePrints Mailer: A small manifestation in a smaller package. Some J2EE blueprint design guidelines.
The original version of the Java Pet Store can use the following database: Oracle, Sybase? And Cloudscape? IBM has created the DB2 port of the application. The app is in the Java 2 platform Enterprise version of the blueprint site http://java.sun.com/j2ee/blueprints/index.html is publicly available. The Java PET Store application is designed as a J2EE "best" application. The application focuses on the elements and techniques of those used to display real world coding.
Functional prevention
Original application Java PET Store is ideaing a consumer to purchase pets online e-commerce applications. When you use the app at first, you can browse and find various types of pets from the dog to reptile. A typical session using Java PET Store is as follows: HomePage - This is the home page that the user is loaded when the user starts using the application. Category View - There are 5 top layers here: each category has several products associated with it. Products - When you select a product in an application, all variables of the product are displayed. Typically, the variable of the product is a female or male. Product Details - Each product variable (indicated) has a detailed view to show the product description, product image, price, and inventory. Shopping Cart - Allows users to operate shopping carts (plus, minus, and update lines). Checkout - Checkout Page Show shopping cart. Log in redirection - When the user selects "Continue" on the checkout page, if the user has not registered, turn to the landing page. Registration Test - After verifying the login to the site, the user will then redirect to the credit card and bill address form. Confirm purchase - Display bills and delivery addresses. Submit order - this is the final step in the order of the processing line. At this moment, the order is submitted to the database at this point.
Microsoft .NET PET SHOP
The goal of .NET PET SHOP is focused on the Java PET Store itself (at this stage did not introduce management and MAILER components to .Net [Note In all code count comparisons, we only do 1: 1 code for functionality Count, do not calculate its code rows for Java management and MAILER applications.]). In addition to implementing the functions of the Java PET Store application, there is an additional addition to two goals:
Between the .NET and J2EE implementations, comparison and comparison of the two architectures, programming logic, and all code sizes of implementing the best applications. This information is included in this document. Provides performance benchmark data related to each application under different user loads. In this paper, the Base is discussed in detail the reference Microsoft® .NET VS. Sun? Microstem's J2EE: performance and scalability (at http://www.gotdotnet.com/compare) summarizes this.
An example of a .NET PET SHOP can be found in Figure 1.
Figure 1. Microsoft .NET PET SHOP
The overall logical architecture of .NET PET SHOP is shown in Figure 2.
Figure 2. .NET PET SHOP logical architecture
There are three logic layers here: the performance layer, the intermediate layer, and the data layer. The three-layer structure clearly separates the different aspects of the distributed application. The transaction logic is packaged into a .NET component (implemented as a C # class library). Database Access is implemented through a class that handles all and SQL Server managed providers. Access the data stored in the database via a stored procedure. The app reflects a full logical three-layer implementation using .NET, and illustrates the best code for Microsoft.net platforms. Figure 3. Example .NET PET SHOP Physical Deployment Map
The architecture of the application
The front portion is directed to the high-rise architecture of the application. In order to better understand how the application works, this part will be a part of the code, the exemplary performance layer, the intermediate layer, and the data layer interaction. In order to further clarify the design, we will study the interaction and implementation details of the shopping cart in each layer, as shown in Figure 4. Figure 4. Architecture
There are a variety of ways to design N-layer applications. The implementation of .NET PET SHOP uses a data-driven method.
database
Several database vendor formats are available for Java Pet Store databases. The first step we take is to import mode (Schema) of the Java Pet Store into SQL Server 2000. This doesn't need to change the mode of the Sybase version. The structure of the database is as follows:
Table name Use Account describes basic consumer information. BannerData stores AD Banner information. Category classification category (ie fish, dog, cat, etc.). Inventory product inventory status. Detail information for a single product of Item. LineItem order details. Orders consumers ordering orders. A order contains one or more rows. OrderStatus Order Status Product Classification Products. Each product may have one or more variables (items). A typical variable is usually a female or male. Profile Consumer User Introduction. Signon consumers' login table SuPPLier supplier related information.
Table 1. Database table name .NET PET SHOP complete physical database mode as shown in Figure 5. Figure 5. .NET PET SHOP Physical Database Mode
After careful consideration, some small changes have been made to the relationship, thereby improving the overall data integrity. However, these changes are not required and will not improve the performance of the application, and they have increased considerable benefits for clarifying database design. Change is:
The foreign key relationship is added between the Signon and the Account tables. The foreign key relationship is added between the Account and the PROFILE tables to the userid and the username column. The foreign key relationship is added between the Favcategorygory column of each table between the Profile and BannerData tables. • Remove the primary key constraint on the OrderStatus table LINENUM column.
The change mentioned above is displayed on Fig. 5. Sun Java Pet Store uses Bean Managed Persistence (BMP) in which the interprise java bean (EJB) is used. Essentially, this provides a mechanism for saving its status to the database. .NET PET SHOP has taken different ways, the intermediate layer component calls the stored procedure in the database. For distributed applications, the use of stored procedures in the database layer is indeed the best implementation means. It provides a clearer separation with the intermediate layer and helps clarify the context and scope of the transaction. Only basic queries are encapsulated during the stored procedure, and the business logic is placed in the intermediate layer .NET class.
Stored Procedure Name Use UpaccountAdd Add an account to the consumer database. UpaccountGetDress adds a new address to the consumer. This stored procedure is used when the bill and transport information are different. UpaccountGetDetails returns detailed information on the consumer account in the system. UpaccountLogin is used to verify users who log in to the site. UpaccountUpdate updates the consumer account information. UpcategorygetList returns a species in the directory. UpinventoryAdd adds inventory information for a specific item. UpinventorygetList gets the inventory status. UpiteMADD adds a product variable (called one) to the directory. UpiteMgetDetails get product information related to a specific product variable. UpiteMgetList returns a list (product variable) belonging to a particular product. UpiteMgetList_ListByPage Returns a list (product variable) belonging to a particular product. Returns data according to user-defined pages. UpordersAdd adds a consumer order to the database. This stored procedure completes its work with OpenXML and SQL Server transactions. Upordersget is used to get a consumer order. UpordersgetDetails returns a complete order details. Uporderstatusget returns a specific order of order. UpproductAdd adds a product to the directory. UpproductGetList returns a list of products in the directory. UpproductGetList_ListByPage Returns a product in the directory. Returns data according to user-defined pages. UpproductSearch executes a product lookup. UpproductSearch_listbypage executes a product lookup. Returns data according to user-defined pages. UPROFILEGETBANNNEROPTION Returns the consumer to show the preference of the advertryment. UpprofilegetListOption Returns the consumer to display the "Pet Favorites" column preferences. Table 2. Database Storage Process In order to enhance the design of the application, the OpenXML feature of SQL Server 2000 is used to return an XML document, not a traditional row collection. This is frequently used during the ordering process because it simplifies the number of parameters necessary to process between the intermediate layer component and the database stored procedure.
middle layer
Sun uses EJB to implement the application's business logic. SUN processes all logic by mixing using entity and session beans to implement the application.
EJB name EJB entity type Account BeanInventory entity BeanOrder entity BeanProfileMgr entity BeanShoppingCart stateful session BeanShoppingClientController stateful session BeanAdminClientController stateless session BeanCatalog stateless session BeanCustomer stateless session BeanMailerStateless Session Bean
Table 3. Java PET Store Business Logic
.NET PET SHOP intermediate layer commercial logic is encapsulated within a single .NET collection. Namespace named PET Shop.components is shown in Figure 6. Figure 6. Intermediate Metal Components Class Window and Scheme Explorer File Window Here are 9 classes, each class is implemented in its own .cs file. The generated set is named PET Shop.components.dll.
Class Note BasketItem's shopping cart. Customer account management and login confirmation. Database uses the ADO.NET data of SQL Server Management Provider. Error is used for log errors. Item represents a product variable. ORDER online ordering business. A product in the Product directory. Profile is used to update your consumer information. ShoppingCart shopping cart function.
Table 4. Intermediate layer components
For code prevention, we will analyze Java and .NET shopping cart function, first start from Java Pet Store. ShoppingCart EJB is a state session bean that means that the object is subject to a specific time when the client request is requested. A common task in any shopping cart page is to add an item to the user bar. Before adding one, the application must first decide which product added. To get product information, we look at the CatalogDAOImpl.java:public Product getProduct (String productId, Locale locale) throwsCatalogDAOSysException {String qstr = "select productid, name, descn" "from" DatabaseNames.getTableName (DatabaseNames.PRODUCT_TABLE, locale) "where" "productid = '" productId "'"; Debug.println ( "Query String is:" qstr); Product product = null; Statement stmt = null; ResultSet rs = null; try {getDBConnection ( ); stmt = dbconnection.createStatement (); rs = stmt.executeQuery (qs.next ()) {INT i = 1; string productID = rs.getstring (i ). Trim (); string name = rs.getString (i ); String descn = rs.getString (i ); product = new Product (productid, name, descn);}} catch (SQLException se) {throw new CatalogDAOSysException ( "SQLException while getting" "product" Productid ":" se.getMessage ());} finally {closResultSet (RS); CloseStatement (); closeConnection ();} return nucleuct;}
Code snippet in Java PetStore. It should be noted that the intermediate layer component in the class definition contains a SQL statement (see QSTR string object). .NET PET SHOP has taken a different approach and clearly encapss all database logic to the stored procedure.
public SqlDataReader GetList_ListByPage (string catid, int currentPage, int pageSize, ref int numSearchResults) {// create data object and paramsSqlDataReader dataReader = null; try {// create params for stored procedure callDatabase data = new Database (); SqlParameter [] prams = {data.makeinparam ("@ cat_id", sqldbtype.char, 10, catid, data.makeinparam ("@ ncurrentpage", sqldbtype.int, 4, currentpage, data.makeinparam ("@ npagesize", sqldbtype.It , 4, pageSize), data.MakeOutParam ( "@ totalNumResults", SqlDbType.Int, 4)}; // run the stored proceduredata.RunProc ( "upProductGetList_ListByPage", prams, out dataReader); numSearchResults = dataReader.RecordsAffected;} catch (EX.TOSTRING ());} Return DataReader;}. Code segment in Net PET SHOP You may notice that .NET version is RunProc (). This is a method in our reusable database class, and in this case, a stored procedure will return a SQLDATAREADER (with the Read-Only, the Forward-Only cursor in the ADO):
public void RunProc (string procName, SqlParameter [] prams, out SqlDataReader dataReader) {SqlCommand cmd = CreateCommand (procName, prams); dataReader = cmd.ExecuteReader (System.Data.CommandBehavior.CloseConnection);}
The code snippet of the .NET PET SHOP data layer This NET PET SHOP code snippet is essentially a framework for all data accesses in the application. The Java application data access mechanism changes from EJB to EJB. There are some session objects here, but for most, the component is managed by bean, meaning that the object itself is responsible for reserving itself for the database, so the built-in SQL code is required. .NET PET SHOP uses the ASP.NET session status to store the contents of the shopping cart (match the functionality of the Java PET Store). This session state is stored in the process, but ASP.NET also includes the ability to run a dedicated status server and also supports SQL Server database session.
Appearance layer
The performance layer of PET SHOP is written in conjunction with the ASP.NET Web Form. Since this site is created using Visual Studio .NET, use the code in the way, the code of each ASPX page is encapsulated in a separate file. The Java PET Store frequently uses servlets (or small publisted HTML Java server programs). Servlet uses a design model called Model View Controller that allows data to be displayed and manipulated in several ways. In addition to user controls, .NET PET SHOP implements the same function using the ASP.NET server control. Since the .NET PET SHOP application uses server controls and session status, you should carefully consider its parameters to achieve high performance. See Table 5 for details on this configuration. ASP.NET WebFormsEnableSessionStateEnableViewStateCart.aspxtrue TrueCategory.aspxtrueTrueCheckOut.aspxreadonlyTrueCreateNewAccount.aspxfalseTrueDefault.aspxfalseFalseEditAccount.aspxfalseTrueHelp.aspxfalseFalseOrderAddressConfirm.aspxreadonlyFalseOrderBilling.aspxtrueTrueOrderProcess.aspxreadonlyFalseOrderShipping.aspxtrueTrueProduct.aspxfalseTrueProductDetails.aspxfalseFalseSearch.aspxfalseTrueSignIn.aspxfalseFalseSignOut.aspxtrueFalseValidateAccount.aspxfalseFalseVerifySignIn.aspxfalseFalse
Table Table 5. WebForm Session Status and Window Status Settings. These settings are included as a row command to the top of each ASPX file.
ASP.NET Output Cache
One of the best ways to improve the performance of a database-driven application is to cancel each query hit database. ASP.NET provides a variety of caching mechanisms that can greatly improve application performance. Use the output cache to remove the contents of the page and store the result in memory. The request to this page comes from the cache and does not need to access the database again. The Java PET Store implemented by Sun has a very simple implementation. Although different J2EE application servers have output cache capabilities (such as IBM WebSphere 4.0), this feature is different from the product. Use these features, when using a specific J2EE application service, you need to modify the Java PET Store source code. The .NET PET SHOP application also uses a partial page (fragment) cache to cache different areas of the page. For example, the cache appears on the header information at the top of each page. However, the header information depends on whether the user is registered (so, we have to cache two different versions of the page). This can easily implement this by using the VarybyCustom on the OutputCache command, ASP.NET can easily implement this. Use VarybyCustom to reload the getvarybycustomstring method to get custom caches of the header.
public override string GetVaryByCustomString (HttpContext context, String arg) {// cache key that is returnedstring cacheKey = ""; switch (arg) {// Custom caching for header control We want to create two views // of the header ... One if the user is logged in and another if // they area: cachekey = (context.user.Identity.Name == ")?" userid_out ":" userid_in "; break;} Return cachekey;} ASP.NET code snippet
Table 6 summarizes all cache settings.
ASP.NET WebForms Cache Setting Duration Note ControlHeader <% @ OutputCache <% @ OutputCache Duration = "43200" VarybyParam = "None" VarybyCustom = "UserID"%> 12 hours Using custom cache call getvarybycustomstring. Returns one of two cache keywords. A user login and the other for the user to log out. Default <% @ outputcache duration = "43200" VarybyParam = "None"%> 12-hour homepage static content. It can be buffered longer. Help <% @ outputcache duration = "43200" VarybyParam = "None"%> 1 hour help page static content. It can be buffered longer. Category <% @ OutputCache Duration = "3600" VarybyParam = "*"%> 1 hour a cache for each category. Product <% @ OutputCache Duration = "3600" VarybyParam = "*"%> 1 hour a cache for each product. ProductDetails <% @ outputcache duration = "60" VarybyParam = "*"%> Since the number of items is displayed, the duration is shorter. Search <% @ outputcache duration = "3600" VarybyParam = "*"%> This is very useful for 1 hour. Since someone is looking for a cash, it is very useful.
Table 6. .NET PET SHOP Cache Settings
As mentioned earlier, in addition to the output cache WebForm, .NET PET SHOP also takes advantage of the fragment cache, allowing the cache page area. Cacked the header ASP.NET user control on each page.
EnableViewState ASP.NET user control output cache Control_Address.ascxtrue noControl_Banner.ascxtruenoControl_Cart.ascxtruenoControl_FavList.ascxtruenoControl_Header.ascxfalseyes, VaryByCustomControl_StaticAddress.ascxtruenoTable 7. user controls the display state of the output buffer provided
Safety
The key components of any application are security factors for applications. Java Pet Store and .Net PET Shop have integrated a variety of security mechanisms to prevent invasion and attacks. .NET PET SHOP uses ASP.NET FORM authentication. These settings are set in the web.config file:
Performance and scalability comparison .NET PET SHOP is compared to a benchmark test and a version of the Java PET Store, which is the Oracle Corporation. He summarizes the results of the overall performance of the application, in the Benchmark Microsoft? NET VS. Sun? MicroSystem's J2EE: Performance and Scalability (http://www.gotdotnet.com/compare) has a complete description. All results of J2EE shown here are brought from the data of Oracle disclosed in its white paper Oracle9IAS J2EE performance research. Using NET PET Shop with NET PET SHOP with NET PET Shop, the hardware configuration includes 2-CPU intermediate layer application servers and 4-CPU database servers. Under the 450 concurrency users, each page User Response Time 450 concurrent users, the user load supported by the APP server CPU utilization 1 second average response time is supported with an ASP.NET output cache. NetMicrosoft .NET PET Shop than Java Pet Store Fast 28 times Java PET Store requires 6 times. Net PET Shop is 6 times more than Java Pet Store supports more than 6 times without ASP.NET output cached .Net.Net Pet Shop is 8 times faster than PET Store. Java PET Store needs to use the CPU to be 4.3 times. NET PET Shop is more than 4 times more than the Java PET Store supports. When the Java Pet Store is imported .NET, we find that you don't need much development time and additional code, you can easily expand the application's feature list to include XML Web Service and support mobile devices. XML Web Service With Visual Studio.net, we quickly add XML Web Service (Based on SOAP and UDDI standards). If you give a given Order ID, you can return to the order details. With regard to describe how to create a full document in Web Service in Visual Studio.NET, which contains direct comparisons with IBM WebSphere 4.0, please see the document in Microsoft .NET and build XML-based Web within IBM WebSphere 4.0 Service comparison, this document http://www.gotdotnet.com/compare can be found. The sample XML output of the getorderDetails () SOAP method in the OrderWebService.asmx Web Service is shown. Figure 8. Example of GetOrderDetails XML Web Service Output Mobile device supports ASP.NET provides some good mechanisms, which are facing a wide range of WEB browsers from the previous version of IE to Netscape. The web application has been extended to a variety of devices that can be used from the Handheld IE of the Handheld IE to a mobile phone using the WAP browser. Microsoft's Mobile Internet Toolbox provides a set of collections allow developers to write a code baseline that supports multiple different devices. During import. Net, we found that if consumers can use mobile phones to see their pet ordering status, it is wonderful. Figure 9. Mobile or order status page is very simple to use the mobile Internet toolbox. After running and installation, there is a new namespace called System.Web.Mobile (System.Web.Mobile.dll). The toolbox is also well integrated with Visual Studio .NET, which can create a page using a visual design interface, as shown in Figure 10. Figure 10. Using Visual Studio .NET development ObileRDERSTATUS.ASPX code for mobile device is as follows: AlternateText = "PET Shop" Imageurl = "../ images / mobile_title.gif"> mobile: image> // go command event handler private void btnGo_Click (object sender, System.EventArgs e) {// verify loginCustomer customer = new Customer (); if (! Customer.Login (txtUsername.Text, txtPassword.Text) = null) {/ / get the list of orders for the specified customerOrder order = new Order (); lstRecentOrder.DataValueField = "orderid"; lstRecentOrder.DataSource = order.GetOrder (txtUsername.Text); lstRecentOrder.DataBind (); lstRecentOrder.SelectedIndex = 0; // advance to the next cardactiveform = RecentRDERSFORM;}}} The last button will check the order status selected in the system. // order status command event handlerprivate void btnCheckStatus_Click (object sender, System.EventArgs e) {// get the order statusOrder order = new Order (); lblOrderStatus.Text = order.GetOrderStatus (lstRecentOrder.Selection.Text); // advance To the results cardactiveform = resultsform; The advantage of using the mobile Internet toolbox is that it is implemented whenever developers can support devices and browsers with a variety of functions. In order to test your mobile phone support for mobile pages, you can find a famous emulator in the OpenWave.com developer section. We use OpenWave SDK Version 4.1 to test the mobile page, you can download OpenWave SDK Version 4.1 at http://developer.openwave.com/download/index.html. in conclusion The Java PET Store is Sun using J2EE technology to create a reference blueprint application for enterprise web applications. .NET PET SHOP is a blueprint application for highlighting the key Microsoft .NET technology and architecture and can be used to establish a blueprint app for enterprise web applications. Now, by using the best coding, the designer and developers can compare .NET and J2EE side by the same reference applications, designers and developers as those of each platform. Appendix 1: Calculating code row Corresponding to the accurate functionality implemented in the .NET PET SHOP application, we are very carefully counting the Java PET Store's code. Since the .NET PET SHOP does not include management features and blueprints MAILER applications, these code lines are not calculated. In addition, we did not calculate the Java PET Store to support the code rows in addition to Oracle other databases. In order to calculate the number of rows of Java and .NET version, we created a program to find the code rows that are important within each file. For example, calculate the number of rows containing a C # or Java code within a file, we want to ignore the blank line and notes. Table 10 lists more than those code line counts within the specific type of file more detail. File types for those rows. All rows containing C # code. Java All rows containing Java code. JS All rows containing JavaScript code., All,., All contains server-side code (C #) .. JSP All Servers. Row of end code (Java). SQL all rows with SQL code Table 10. Counting code rows In addition, for .asax, .aspx, and .jsp files, if there is more than one server-side block (by <% and%> segmentation) in the same row, each is a separate line count. For all other file types (such as .xml), count all rows. The rows involved in the program meet the LEX vocabulary specification, Lex is a vocabulary analyzer and code generator. In our case, we use flex, which is the GNU LEX, and its source code can be free from the Free Software Association. Each can be used to generate a C source file from the specification file. You can compile C file into an executable file sequentially. Makefile used for VC6 and VC7 is included in the distribution. The process is very simple. Depending on the file type to be counted, if you specify the count file on the command line, or if the file is transmitted from another source, the program accepts zero, one or two command line command line variables. Table 11 describes the acceptable command line variables and how they are used. The file type (empty) assumed file hybrid file mixed contains the HTML and server-side code. .asax, .aspx, .jsp-all calculates all other files (such as .html, .xml, and .txt) -code only calculate the code line .cs, .java, .js-SQL only calculate the SQL code line. SQL Table 11. CLOC command line variables Because the count function cannot accept more than one file each time, we create a batch file collection for Java and .NET version, which helps to count all the lines in all directories. These files are also included in the distribution. In our makefile, we decided to use Flex to generate a C source file with a .cpp extension. Since VC compiles such as C files, then allow us to use Bool types and provide us with better type. However, it is also required to reference a unisted.h file. This is a standard reference file on many systems, but is not part of Visual C . However, since this file does not contain any declarations related to our role tool, it is best to use an empty file. If you want to generate a line calculation result, you can run the batch file yourself. First, expand USED.BAT, generate a file extension within the directory hierarchy. Specify the top-level directory path of the directory level as the unique command line variable. The file without an extension is not displayed in this column, but there is no extension of the file we need to count. We run the batch file in the Java version and .NET version to determine each file extension. Table 12 lists the file extensions used in each version, and file extensions used to calculate the total number of rows. Platform counting extension is not counted extensions Javajava, JS, JSP, SQL, TLD, TXT, XMLBAT, HTML, MF, SH.NETASAX, ASCX, ASPX, CMD, CSS, HTML, GIF, JPG, RESX, VBS, VSDISCO Table 12. Extension Other two batch files, java lines.bat, and .net lines.bat, each calculated the number of files from Java and .NET editions. Because these batch files look out different, they are independent, as shown in Table 12. The use of these two batch files is the same. They all use the path to the top of the directory level as a single command line variable to find files to count. In order to obtain row counts of different layers, we run a specific subdirectory and contain only specific extensions of the batch file, as shown in Table 13. Platform Performance Logic Database Configuration Java Extensions Java, JS, JSP, TXT, XMLJAVA, TXT, XMLSQL TLD Subfinder WebComponentsDatabase Table 13. Last code classification Even if it is not desirable to cross-platform, determine a satisfactory number of line counts across different file types is also difficult enough. For example, we don't count the HTML file because the format of HTML generated using different tools on different platforms may vary, so that the code count will be different. Even if it is used to format how the logical layer file is formatted, it is worth explanating that the difference between Java files and CS files is still very large, these numbers are enough to explain the number of infrastructure on the .NET platform, which is conducive to developers to concentrate The problem itself, rather than selling energy in the lack of infrastructure.