Fog Creek Software
Discussion Board




Learning EJB and Struts - what are they in .NET

I am starting the process of learning J2EE - mainly for my own interest. Most of my working life has been in Microsoft technologies.

I knowing programming languages well and have a good knowledge of java.

The challenge and interesting part of learning J2EE environment are the diverse sources of information. I would like to start as early as possible differentiating facts from hype.

I have started reading on EJB and Struts. I was wondering what the posters here thing of these technologies - what practical uses have you seen for them.

I am pretty confident with .NET stuff and can usually tell what are the useful stuff and which willl be stuff that may be useful down the road - like web services - maybe.

Ram Dass
Thursday, August 28, 2003

Also while your at it can a J2EE expert explain what Java Server Faces is? I'd like to know if this is related to Struts at all? Are Java Server Faces something like Web Forms in .Net or no? Does Java have or are they planning to have HTML Server Controls like .NET Web Forms have?

Thanks in advance....

GenX'er
Friday, August 29, 2003

Most people I know can barely figure out what EJBs are, nevermind use them properly (it took me a long time to figure it out - it almost seems like Sun is trying to keep it secret with its gobbledygook explanations). I personally feel that EJBs aren't necessary to write well-designed/modular code - there's just not enough infrastructure in place to support the claim that it's... well, an infrastructure. .NET has no EJB equivalent, so I guess Microsoft agrees with me.  :)

Struts are well-intentioned but I don't think the benefits of having an official controller component will outweigh addition of a meta language. Many people will try it because they get off on knowing every new Java technology, but most will stick with Model 2.

.NET is more like Model 2 - I don't *think* it has anything that compares to Struts, and that's okay.

As for the statement that web services *might* be useful, I'd say that the definitely will be. I see the core benefit of web services being the ability to take tasks out of the users' hands (i.e., searching for, analyzing, and applying bug fixes to code) and let the computer do them (which is why we invented computers in the first place). By formatting data precisely via XML, you allow software to perform dynamic and distributed tasks more easily than if everyone is doing their own thing. And it's really not that new to a lot of companies...

   
Friday, August 29, 2003

I thought Struts = MVC = Model 2?

John Topley (wwwljohntopley.com)
Friday, August 29, 2003

Java Server Faces provides a similar service to .Net Web Forms, a reusable compenentized web based architecture that takes of things like event handling, marshalling values, persisting state, etc. I haven't looked at it great depth, it's still in beta and the beta implementation is based around JSP which I don't have much love for.

In terms of EJB, I believe Microsoft is working on an object persistence layer called ObjectSpaces. Again I haven't look at it in any great depth, but it looks like it will match up with some of the EJB spec, namely entity beans. Personally, I'm not a huge fan of EJB, tries to be to many things and does none of them particularly well. If you want object persistence in Java, Hibernate is generally a better choice IMHO.

Gerald
Friday, August 29, 2003

EJB
- here you have session beans - the equivalent in .NET are
  attributes to specify how an object takes part in 
  transaction, etc.
- entity beans - bloat.  almost everybody hates them.
  (see the ejb patterns book)

STRUTS
  - Microsoft doesn't like controlers, Documents and views
    are enough for ordinary applications (see MFC)
    a controller is sort of overkill for a ordinary business 
    application.
    In fact you have a problem with document and view 
    architecture if you want to create a RAD (rapid application
    development environment).
    RAD tool needs a flexible GUI framework to churn out
    lots of code + flexible DB stuff.
    I guess they took the dot com boom told them that
    you have to churn out code at quick speed (once you
    are on to a business oportuinity) - hence they try
    to position .NET as a RAD environment; sort of
    we are better then JAVA in terms of productivity, the
    main .NET mantra.

Michael Moser
Saturday, August 30, 2003

Okay, I'll look foolish and try to answer.

I'll probably get jumped on for this, but I'd say that, in terms of understanding their purpose, EJBs are like COM objects in MS world. That is, they're a thing, out on the network, that you create/access/etc. EJBs are used in a java environment for much the same purposes as COM objects in an MS environment. This is a very loose analogy, but it will do for an initial understanding.

Struts is a web application framework. Web application framework is a fancy way of saying:
1. I've written dozens of web applications.
2. and I've noticed that there are several bits of code that are common between them.
3. so lets put all those common parts in a library and build the web application parts off of that.

Struts is only one of many application frameworks. And people's opinion of each is based generally on how closely they come to the developer's style.

Bill Tomlinson
Tuesday, September 02, 2003

*  Recent Topics

*  Fog Creek Home