Anda di halaman 1dari 7

How .NET overtakes J2EE?

INTRODUCTION
The .NET platform consists of many things wrapped into a single name. It offers first of all a language-agnostic model some languages from !icrosoft "C# C$$ %&.NET etc' among others from other (endors that can all interoperate as desired. )econdly all of these languages compile down into an intermediate format which must *e translated into nati(e machine code *efore it can *e e+ecuted, this is the responsi*ility among others of the Component -anguage Runtime the runtime model of .NET. C-R is in many ways the heart and soul of the .NET platform .ust as the /a(a %irtual !achine "the /%!' is of the /a(a platform. Thirdly li0e /a(a the .NET platform ships with a rich and impressi(e set of li*raries with precanned functionality *uilt in. UI support Data*ase access support remoting support 1!and more all come as part of the .NET )D2 and are a(aila*le to all languages e3ually. -astly as is to *e e+pected .NET is also a mar0eting strategy ".ust as /a(a is to )un' that see0s to discredit its competitors and praise its partners. Unli0e /a(a it is not an attempt at (endor neutrality *ut is firmly controlled *y !icrosoft, it is not a specification *ut an actual *inary set of *its.

COMPARISONS OF J2EE AND .NET

CLR and JVM: - .NET also offers a fully /IT-compiled model in that all code compiled for the C-R is compiled into Intermediate -anguage "I-' *yte codes which are then at runtime translated into nati(e code as the code is loaded into the C-R. -i0e the /%! this allows for greater long-term optimi4ation opportunities as well as greater porta*ility and easier language generation and will ser(e significant ad(antages when 56-*it platforms *egin to ma0e their mo(e into the mar0et space. )un7s literature says that /a(a7s %! was designed to allow any /a(a program to *e run on any platform with a compliant %!. On the other hand !icrosoft emphasi4es that their (irtual machine called the Common -anguage Runtime "C-R' was designed to allow code written in any language to run under .NET which is primarily associated with 8indows. C-R for 9ree&)D is a(aila*le.

/%! pro(ides no way of encoding type-unsafe features of typical programming languages such as pointers immediate descriptors "tagged pointers' and unsafe type con(ersions. 9urthermore in many cases the /%! lac0s the primiti(es to implement language features that are not found in /a(aT! *ut are present in other languages. E+amples of such structures include un*o+ed structures and unions "records and (ariant records' reference parameters (arargs multiple return (alues function pointers o(erflow sensiti(e arithmetic le+ical closures tail calls fully dynamic dispatch generics structural type e3ui(alence etc. In contrast to the /%! where all storage locations "local (aria*les stac0 slots arguments' are 6 *ytes wide storage locations in the C-R "Common -anguage Runtime' are polymorphic in the sense that they might *e 6 *ytes "such as a :; *it integer' or hundreds of *ytes "such as a user-defined (alue type' *ut their type is fi+ed for lifetime of the frame. Natural si4ed types offer a significant ad(antage o(er the /%! which prematurely commits all storage locations to *e :; *its wide. This implies for e+ample that (alues of type long or dou*le occupy two locations which ma0es things unnecessarily hard for compiler writers. < uni3ue feature of the C-R is that it7s metadata is user e+tensi*le (ia the notion of custom attri*utes. The /%! does not allow compilers to ta0e the address of local (aria*les hence it is impossi*le to implement *yref arguments directly. Instead compiler writers ha(e to resort to tric0s such as passing one-element arrays or *y introducing e+plicit *o+ classes "the /%! does not support *o+ing and un*o+ing either'. The C-R supports the usual (ariety of "conditional' *ranch instructions "such as *r *e3 *ge etc.'. There is no analog of the /%! =.ump su*routine= instruction. <lso the C-R does not limit the length of *ranches to 562 as the /%! does "which might not *e a *ig deal for humans programming in /a(a *ut it is a real pro*lem for compilers generating /%! *yte code'. C-R is already strictly more powerful than the /%! as a multi-language platform. CLIENT SIDE TOOLS 9or /;EE application de(elopment we ha(e tools called /*uilder %isual <ge )un>tm? ONE )tudio 6"9orte' etc. 9or .Net application de(elopment we ha(e !icrosoft7s %isual )tudio .NET. IDE. %).NET is as good as or *etter than any /a(a IDE on the mar0et. In general it does what you e+pect and then goes at least one step further. One of my fa(orite features is the way it chec0s synta+ and highlights errors as you type. The error description shows up when you place the mouse cursor o(er the highlighted synta+. !ost importantly it includes *uilt-in support for disco(ering and reading the definition of we* ser(ices *ased on the Internetstandard )O<@ and UDDI protocols. This ma0es it easy to *uild applications that consume we* ser(ices. E(en the de*ugger is somewhat incredi*le in that it can step seamlessly from local code to remote code and e(en into stored procedures pro(ided you are using !icrosoft )A)er(er. !E" SERVICES 8e* ser(ices are ser(ices offered (ia the 8e*. In a typical we* ser(ices scenario a *usiness application sends a re3uest to a ser(ice at a gi(en UR- using the )O<@ protocol o(er BTT@. The ser(ice recei(es the re3uest processes it and returns a response. )upport for 8e* ser(ices is tightly integrated into %isual )tudio .NET. It pro(ides *oth support for the de(elopment of 8e* ser(ices and support for accessing 8e* ser(ices. The de(elopment of a 8e* ser(ice in !icrosoft .NET results in a D-- which can *e deployed to the Internet Information )er(er. 9orte for /a(a the de(elopment en(ironment of )unONE integrates support for 8e* ser(ices as well. The !icrosoft )O<@ implementation has *een fully integrated to !icrosoft .NET. Classes for handling )O<@ messages and communication are contained directly within the !icrosoft .NET 9ramewor0. The )O<@ support of )unONE is not as integrated as within !icrosoft .NET. !icrosoft pro(ides the UDDI )oftware De(elopment 2it to handle UDDI registry information or operate a local UDDI registry for test purposes. The )D2 is implemented as a managed code

class li*rary that pro(ides a simple programming model to manipulate the re3uest and response data necessary to interact with a UDDI registry from %isual )tudio.NET applications. There is almost no support for UDDI within the )unONE IDE. DATA"ASE CONNECTIVIT# &oth platforms ha(e to support the ma.or re3uirement of *usiness that of o*taining data from the relational data*ase. 9or /a(a de(elopers this is done most typically using the /D&C li*raries and an appropriate dri(er from the data*ase (endor. Under .NET this role is relegated to the <DO.NET li*raries. <DO.NET applications can ta0e ad(antage of the fle+i*ility and *road acceptance of 1!-. &ecause 1!- is the format for transmitting datasets across the networ0 any component that can read the 1!- format can process data. <DO.NET data components in %isual )tudio encapsulate data access functionality in (arious ways that help us program more 3uic0ly and with fewer mista0es. <DO.NET accommodates scala*ility *y encouraging programmers to conser(e limited resources. &ecause any <DO.NET application employs disconnected access to data it does not retain data*ase loc0s or acti(e data*ase connections for long durations. PRICE COMPARISION -et us first consider the price of de(elopment en(ironment. <t the time of writing the price of %isual )tudio .NET Enterprise (ersion is U) CDEEF. )un7s )un>tm? ONE )tudio 6 Enterprise (ersion price is U)C DFFG. 9or latest price information please refer the following lin0s. - httpHIImsdn.microsoft.comI(studioIhowto*uyIpricing.asp - httpHIIwwws.sun.comIsoftwareIsunde(I.deI*uyI Now consider the deployment en(ironment. < consortium called the Transaction @erformance Council "T@C' specifies the industry standard *enchmar0 for transactional throughput and the *enchmar0 is called the T@C-C *enchmar0. T@C mem*ers include )un I&! Oracle &E< !icrosoft and most other companies that sell for the middleIdata tier. The T@C-C *enchmar0s rates the highest wor0load that a system can achie(e. The unit of measure is tpmC for transactions per minute as defined *y the T@C-C *enchmar0. 9or /;EE application we ha(e to *uy 8e*-ogic we*sphere i@lannet etc. That again depends whether the platform is <I1 UNI1 )olaris etc. The application ser(er price (aries according to the target platform. The .NET platform includes the following .NET Enterprise )er(ers. !any of these are repac0aging of e+isting products under a common mar0eting termH )A- )er(er ;JJJ is !icrosoft7s relational data*ase. E+change ;JJJ )er(er is a messaging and colla*oration platform useful in de(eloping and running core *usiness ser(ices and is now tightly integrated with 8indows ;JJJ. Commerce )er(er ;JJJ offers you 3uic0er and less complicated de(elopment and deployment of customi4a*le online e-commerce solutions. <pplication Center )er(er ;JJJ lets us manage clustered ser(ers. Bost Integration )er(er ;JJJ gi(es you access to selected legacy systems running on other platforms "primarily I&!-*ased'. Internet )ecurity and <cceleration "I)<' )er(er ;JJJ offers firewall and 8e* caching capa*ilities. &i4Tal0 )er(er ;JJJ is !icrosoft7s 1!--*ased colla*orati(e e-*usiness solution for integrating applications trading partners and *usiness processes (ia the Internet. Now consider hardware from well-0nown (endors for *oth ser(ers.

J2EE Severs

Co$%a&' S'ste$ &ull I&! &ull I&! &ull I&! Escala T5DJ cIs R)I5JJJ Enterprise )er(er 9KJ Escala E@CKDJ cIs R)I5JJJ Enterprise )er(er !KJ Escala E@C;6GJ I&! e)er(er p)eries 5KJ !odel EJDE-)KG

t%$C D5 EKG D5 EKG :: :EG :: :EG

Tota( S's. Cost CD FKJ DEF C; J;5 5KD C: J:E 6FF C: JFE JGG

DDJ 6J: CF G5: ;5: DDJ 6J: CF G5J GF6

.NET Servers Co$%a&' S'ste$ Dell Compa3 Dell I&! Compa3 Compa3 Compa3 Compa3 Compa3 @owerEdge 66JJ @ro-iant !--GEJ-5IEJJ-:@ @owerEdge 56JJ Netfinity E5JJ cIs @ro-iant KGJJ-1GGJ-56@ @ro-iant KGJJ-1EJJ-56@ @ro-iant KGJJ-1GGJ-F5@ @ro-iant KGJJ-1EJJ-F5@ @ro-iant KGJJ-EJJ-DF;@ t%$C D5 ;5: ;J ;JE :J ;:D :; :EE Tota( S's. Cost C;E: 6KE C;JD EDE C::6 5;5 C66: 65:

D5D E;J C: G:6 ;E; DEF 5GK C: G65 GK; ;;F FD6 CG :JG GED ;5; ;66 CG :JG GED GJG :J: CDJ JJ: K;5

Now .ust compare a .Net ser(er and /;EE ser(er cost for same tpmC (alue. COMPARISON OF "ENCHMAR)IN* APPLICATIONS. Bere is the comparison of )un7s @etstore and !icrosoft7s @etshop applications.

The main *enefit of !icrosoft .Net is that it7s a complete platform -- /;EE is only oriented toward ser(er de(elopment. !ore than that /;EE is .ust a specification set -- you must purchase an e+pensi(e "usually CDG JJJIC@U' implementation of the /;EE specifications to ma0e them real. !icrosoft .Net *y contrast is a set of products and ser(ices. In addition

!icrosoft .Net has 1!- 8e* ser(ices *uilt into the platform rather than as a simple *olt-on to a tool. This leads to su*stantial performance and de(eloper producti(ity gains. !icrosoft .Net was also *uilt for integration through 1!- 8e* ser(ices using protocols and file formats such as )O<@ 8)D- and UDDI. -et us compare rest of the features of .NET and /;EE as shown *elow. Para$eter @latform -anguages Client side tools 8e* Client J2EE /RE )upported O) /;EE supports /a(a and only /a(a /*uilder %isual <ge 9orte )unOne )tudio /a(a <pplets are used to pac0age /a(a code that will run within the *rowser /a(a )er(lets /a(a )er(er @ages Enterprise /a(a &eans "E/&'. The current implementations of entity *eans are dependent on middle tier data caches that are independent of the data*ase caches. Unfortunately there is no mechanism for maintaining coherency *etween the two caches. This means that any usage of entity *eans introduces a high ris0 of data*ase corruption. E/& fla(ors include "stateless and stateful' session *eans and entity *eans "component- and *eanmanaged' M+,roso-t .NET 8indows "C-R for 9ree&)D is a(aila*le' !ore than ;J$ supports /a(a also %isual )tudio.NET This is functionally e3ui(alent to <cti(e1 <)@.NET we* ser(ices we* applications .NET Remoting CO!I.NET Component The 0ey ideas first introduced *y !T) and then incorporated into *oth E/& and CO!$. The first of the /;EE specifications the E/& specification came out in DFFK. 8hile .NET currently only includes support for components similar to stateless session *eans This represents a difference in architectural (ision *etween !icrosoft and the /a(a Community @rocess "/C@'.

8e* tier !iddle Tier

Data*ase Connecti(ity

/a(a Data*ase Connection "/D&C' <DO.NET ;.J - The <@I for accessing relational data*ases from /a(a This is somewhat similar to the <cti(e Directory )er(ices Interface "<D)I' in the .NET platform space This is functionally e3ui(alent to !icrosoft !essage Aueue <@I which in the component space has *een superceded *y 3ueued components CO!$ )ecurity Call Conte+t The .NET platform eColla*oration model is as I ha(e discussed at length *ased on the UDDI and )O<@ standards. The reality today is that the .NET platform has a much stronger technology neutral eColla*oration strategy that does /;EE. I&! is so con(inced that UDDI rather than IIO@ is the correct

Directory ser(ices /a(a Naming and Directory Interface "/NDI' - The <@I for accessing information in enterprise name and directory ser(ices from /a(a !essage Aueue /a(a !essage )er(ice "/!)' D.J The /a(a <@I for asynchronous wor0flow. /a(a <uthentication and <uthori4ation )er(ice "/<<)' )un has primarily focused on interopera*ility *etween /;EE (endors and to a limited e+tent with COR&< (endors. )un7s idea of interopera*ility is that it should *e *ased on the communications protocol called IIO@.

)ecurity Interopera*ility

approach to interopera*ility that it has *ro0en with )un o(er this issue. <t this point it is painfully o*(ious that IIO@ despite its ten year head start o(er UDDI has *een a complete failure Commerce There is no e3ui(alent (endorneutral framewor0 in the /;EE space )un Clustering Role *ased Ba(e primiti(e types and classes primiti(e types are *uilt-in, we write classes The .NET platform includes such an eCommerce framewor0 called Commerce )er(er 8indows N-&) <pplication Center )er(er ;JJJ Role *ased security Code access security %alue types and reference types %alue types LL primiti(e types that we can write Reference types LL class <ll types e+tend )ystem.O*.ect &oth pass-*y-(alue and pass-*yreference E+posed at the C-)IC-R le(el-languages can choose to support or not C-R supports e+ceptions E+plicit support (ia attri*utes in I<gain languages support as they wish Delegates pro(ide loose coupling of call*ac0s E(ents use delegates and Iattri*utes <ll methods are non(irtual *y default !ethods can *e mar0ed (irtual !ethods can also =hide= *ase-class (irtuals Deployment is always an assem*ly ".E1E or .D--' Configuration--all done (ia 1!- "No RegistryN' %ersion info e+posed (ia attri*utes -oader fully supports (ersioning Use )ystem.Reflection for run-time disco(ery Use )ystem.Reflection.Emit to create types 8in9orms pro(ide traditional MUI access 8e*9orms pro(ide we*-centric UI controls )upport intrinsic in )ystem.1!-.dll Includes 1@ath 1)-T 1Include and

Clustering 8e* )ecurity Types

@arameter passing

@ass-*y-(alue semantics Copies of o*.ect references are passed not o*.ects

E+ception Components

E+ception-enforcement at compiletime only Through well-0nown idioms "getIset methods listeners' Mreater customi4ation through &eanInfo.

@olymorphism

<ll methods are (irtual E+ceptions include pri(ate and static methods Deployment is a ..ar file sometimes Configuration--manifest files . properties files deployment descriptors %ersioning is mentioned in manifest No loader support Use .a(a.lang.reflect "Reflection' <llows for runtime disco(ery of type info Use Class-oaders for run-time manipulation of code <8T was the first )wing supercedes <8T in a *ig way

Deployment

%ersioning !etamodel

MUI client apps

1!-

)upport through /<1@ and e+ternal li*raries

Used e+tensi(ely in /;EE for deployment descriptors @arsers 1)-T will *e rolled into /D2 D.6

so on Used for configuration files

LATEST INFORMATION !icrosoft has released the /U!@ tool0it and /#.NET ma0ing it as simple as possi*le to mo(e from /a(a to C#. The C# language itself is designed to ma0e /a(a ports 3uic0 simple and painless. Balcyon )oftware has released iNET a C#-to-/%! *yte code translator which plugs into the %isual )tudio.Net suite of tools. iNET allows C# to *e used to generate /%! *yte code later *e e+ecuted within a /a(a %irtual !achine. The hoo0 here is that the de(eloper is targeting the /a(a runtime *ut wor0ing learning and *uilding in .NET languages. Remotesoft has released /a(a.NET a tool for running nati(e /a(a code within the .NET en(ironment. This con(ergence tool targets .NET as the runtime en(ironment for the resulting application written in /a(a. The product includes .NET-language access to /a(a class li*raries and translation of nati(e /a(a source to .NET-compati*le C# and !)I-. CONCL.SION !icrosoft .NET pro(ide enterprise solutions in an efficient scala*le and cost effecti(e manner. It supports so many features that cannot *e done *y /;EE. Bence with in few years !icrosoft .NET definitely o(erta0es /;EE and ma0e enterprise solution easier.

Anda mungkin juga menyukai