Oracle has released a new new Struts/BC4J based Toy Store Demo and accompanying detailed technical whitepaper.
This demo and its accompanying detailed technical whitepaper illustrate best practices techniques for building a simple web storefront application as an MVC-style web application using existing frameworks.
View the BC4J Toy Store:
http://otn.oracle.com/sample_code/products/jdev/bc4jtoystore/content.html
In particular, the demo shows how to use
-> Jakarta Struts for the Controller layer
-> JSP for the View layer
-> Oracle's BC4J J2EE framework for the Model layer
in a way that maximizes "out-of-the-box" functionality for the developer, and minimizes the amount of application infrastructure code that needs to be authored by hand.
The demo is designed to look and work similarly to the original "Java Pet Store" demo that Sun published a fews years ago, so hopefully it will be instantly familiar to anyone who has played with or looked at that demo. It comes translated into English, Italian, and German to illustrate the multilanguage features of Struts and BC4J as well.
Technical questions on the BC4J framework can be posted in the Oracle Technet JDeveloper discussion forum.
-
Oracle Releases Struts / BC4J Toy Store Demo and Whitepaper (17 messages)
- Posted by: Steve Muench
- Posted on: April 28 2003 08:51 EDT
Threaded Messages (17)
- Struts version? by Craig Doremus on April 28 2003 16:43 EDT
- Struts version? by Steve Muench on April 28 2003 17:07 EDT
- The Loss of OO by Andrew Nortje on April 28 2003 16:58 EDT
- The Loss of OO by Steve Muench on April 28 2003 18:55 EDT
- BC4J / Struts by Muhammad Mansoor on April 28 2003 22:58 EDT
- BC4J / Struts by Steve Muench on April 29 2003 03:25 EDT
- Some function does not work!! by Web Master on April 29 2003 22:46 EDT
- Some function does not work by Steve Muench on April 30 2003 05:28 EDT
-
Help here by Web Master on April 30 2003 02:54 EDT
- Help here ( Error explained on Drive into BC4J Site) by Randall Vasquez on May 01 2003 12:24 EDT
- Some function does not work by Steve Muench on May 01 2003 06:19 EDT
-
Help here by Web Master on April 30 2003 02:54 EDT
- Some function does not work by Steve Muench on April 30 2003 05:28 EDT
- Some function does not work!! by Web Master on April 29 2003 22:47 EDT
- Oracle Releases Struts / BC4J Toy Store Demo and Whitepaper by Eric Ma on May 01 2003 08:53 EDT
- BC4J is still a prototype tool or alternative Oracle-Form by James Yao on May 01 2003 10:00 EDT
- Correction to my previous post by James Yao on May 01 2003 10:02 EDT
- BC4J is still a prototype tool or alternative Oracle-Form by Steve Muench on May 01 2003 12:56 EDT
- Oracle Releases Struts / BC4J Toy Store Demo and Whitepaper by Steve Muench on May 01 2003 12:38 EDT
- BC4J is still a prototype tool or alternative Oracle-Form by James Yao on May 01 2003 10:00 EDT
-
Struts version?[ Go to top ]
- Posted by: Craig Doremus
- Posted on: April 28 2003 16:43 EDT
- in response to Steve Muench
What version of Struts are you using in this application (and within JDeveloper 9.0.3)? I searched in the on-line documentation for a while, but couldn't find this information. -
Struts version?[ Go to top ]
- Posted by: Steve Muench
- Posted on: April 28 2003 17:07 EDT
- in response to Craig Doremus
JDev 9.0.3 ships with Struts 1.1 Beta 2 in the distribution. -
The Loss of OO[ Go to top ]
- Posted by: Andrew Nortje
- Posted on: April 28 2003 16:58 EDT
- in response to Steve Muench
What bothers me with many J2EE Domain Models is the loss of OO (IMHO), because of difficulty with good O/R mapping? Domain Models often look like views into the database, which seems to me to be the case here. Classes need to get back their first class status, too often they are relegated to getter setter second class citizens.
Looking at the Domain Model classes and code where is the Order class. Having OrdersImpl.java doesn't seem right. Orders should preferably just be a collection of Order. What about an addOrder(Order order) method on AccountImpl.java. Account can then do some Domain rule checking before adding the new Order to the collection of orders. -
The Loss of OO[ Go to top ]
- Posted by: Steve Muench
- Posted on: April 28 2003 18:55 EDT
- in response to Andrew Nortje
In this case, the demo was consciously trying to keep to the table "shapes" from the original Java Pet Store demo.
You're right that the "Orders" entity object should have been named just "Order". That went unnoticed.
Account does have a collection of related orders called "Orders" (accessor method getOrders()) which returns an iterator to the collection of related "Orders" entity object instances. With your suggested renaming, it would return an iterator to the collection of related "Order" instances. And I agree that would sound better name wise.
BC4J also fully supports the use of Java inheritance and automatically manages the storage of family hierarchies into a single table using a discriminator column. This allows us to support very easy polymorphic queries as well, which return objects of different entity types from a query. -
BC4J / Struts[ Go to top ]
- Posted by: Muhammad Mansoor
- Posted on: April 28 2003 22:58 EDT
- in response to Steve Muench
We have been using Struts as the Framework for most of our clients. It will be really intresting to see that if JDeveloper provides coding ease like IntelliJ has for Scriptlets & TLD's. In any case the JDev IDE looks very promising and powerfull.
Regards,
Mansoor -
BC4J / Struts[ Go to top ]
- Posted by: Steve Muench
- Posted on: April 29 2003 03:25 EDT
- in response to Muhammad Mansoor
JDeveloper does offer extensive context-senstive "code insight" and "tag insight" for on-the-fly syntax help for Java code, JSP and HTML tags, JSP Tag library tag and attributes, and XML-Schema-driven tag insight for any XML file based on an XML Schema. -
Some function does not work!![ Go to top ]
- Posted by: Web Master
- Posted on: April 29 2003 22:46 EDT
- in response to Steve Muench
I tried the toy store example on JDeveloper this after. The "new user registration" function does not work. I am not sure if it is my fault. -
Some function does not work[ Go to top ]
- Posted by: Steve Muench
- Posted on: April 30 2003 05:28 EDT
- in response to Web Master
I've heard back from many users that the demo works for them, so we'll need to look into your specific case. Please post a question in the Oracle Technet JDeveloper discussion forum explaining what doesn't work about it, and then email me the URL to your Forum posting so I can investigate and answer the question in the public forum so others can benefit by the answer, too.
You can visit the JDev discussion forum at this URL:
http://www.oracle.com/forums/forum.jsp?forum=83
Thanks. -
Help here[ Go to top ]
- Posted by: Web Master
- Posted on: April 30 2003 14:54 EDT
- in response to Steve Muench
I posted my problem in that forum, but got no response. Maybe posting here can get some help. Below is the Error I got:
500 Internal Server Error
java.lang.NoSuchMethodError: void oracle.jbo.Row.setNewRowState(byte)
org.apache.struts.action.ActionForward oracle.jbo.html.struts11.actions.EditAction.create(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
EditAction.java:98
org.apache.struts.action.ActionForward toystore.controller.strutsactions.RegisterAction.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
RegisterAction.java:30
org.apache.struts.action.ActionForward org.apache.struts.action.RequestProcessor.processActionPerform(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.Action, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)
RequestProcessor.java:446
void org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
RequestProcessor.java:266
void org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
ActionServlet.java:1292
void org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
ActionServlet.java:492
void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
HttpServlet.java:740
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
HttpServlet.java:853
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
ServletRequestDispatcher.java:721
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
ServletRequestDispatcher.java:306
boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
HttpRequestHandler.java:767
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
HttpRequestHandler.java:259
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
HttpRequestHandler.java:106
void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
PooledExecutor.java:803
void java.lang.Thread.run()
Thread.java:484 -
Help here ( Error explained on Drive into BC4J Site)[ Go to top ]
- Posted by: Randall Vasquez
- Posted on: May 01 2003 00:24 EDT
- in response to Web Master
Check out the link http://radio.weblogs.com/0118231/
hope it helps. -
Some function does not work[ Go to top ]
- Posted by: Steve Muench
- Posted on: May 01 2003 06:19 EDT
- in response to Steve Muench
I posted an answer to your question in the JDeveloper OTN Forum, and in case others might hit the same installation issue, I posted the solution on my "Dive into BC4J" weblog as well at:
http://radio.weblogs.com/0118231/2003/04/30.html -
Some function does not work!![ Go to top ]
- Posted by: Web Master
- Posted on: April 29 2003 22:47 EDT
- in response to Steve Muench
I tried the toy store example on JDeveloper this afternoon. The "new user registration" function does not work. I am not sure if it is my fault. -
Oracle Releases Struts / BC4J Toy Store Demo and Whitepaper[ Go to top ]
- Posted by: Eric Ma
- Posted on: May 01 2003 08:53 EDT
- in response to Steve Muench
Steve:
I asked this question at the OTN forum last year and hope you don't mind me asking this again: what does it take to make BC4J an open source framework? Does Larry Ellison have to personally endorse it? Is Oracle thinking to make tons of money selling the framework, because it cannot sell Oracle9iAS and has to make up the revenue shortfall somewhat? It doesn't help when a framework is being used by 1000 projects internally by its vendor, while the rest of the developer community still sees BC4J as a proprietary product that targets one of their many problems (data persistence in this case), and I'm sure you know what proprietary is perceived as in the J2EE space today. -
BC4J is still a prototype tool or alternative Oracle-Form[ Go to top ]
- Posted by: James Yao
- Posted on: May 01 2003 10:00 EDT
- in response to Eric Ma
Frankly speaking, BC4J is not ready for any production for commercial internal project. I still regard BC4J as PL/SQL guy writes java in PL/SQL. Oracle need some real Java guy ... or they just write everything as PL/SQL.
conclusion: They know "OO" as "Ouch!Oracle..." -
Correction to my previous post[ Go to top ]
- Posted by: James Yao
- Posted on: May 01 2003 10:02 EDT
- in response to James Yao
Correction: Frankly speaking, BC4J is not ready for any production for commercial *Internet* project.
Anyway, the bright side is internal/intranet prototype/admin project. I successfully utilized on internal admin project .... better than oracle form ... RAD ... easy to maintain if developer is not laid off ... -
BC4J is still a prototype tool or alternative Oracle-Form[ Go to top ]
- Posted by: Steve Muench
- Posted on: May 01 2003 12:56 EDT
- in response to James Yao
James,
We've been steadily improving the framework since November 1999, before the J2EE community even invented fancy design pattern names for many of the features that we've implemented (and continued to improve) for years. :-)
Since you provide no specifics about what gives you the impression that BC4J is a "prototype tool", I cannot try to help you understand how this statement could not be farther than the truth. Hundreds of external customers (and over 50 internal app development teams) use it to build much more than prototypes. I help answer questions for these customers every day in the OTN JDeveloper forum.
I don't understand your PL/SQL comment. BC4J is 100% Java and designed for J2EE/Java developers. Everything you do we BC4J is either done declaratively via XML configuration descriptors, or done by writing Java methods that override framework lifecycle methods.
The fact that our framework let's you fully exploit SQL, is a feature that most developers end up having to write "fast-lane reader" pattern SQL clauses to do anyway. As my two BC4J whitepapers illustrate, all we do is provide you with a bunch of appliation infrastructure code that you won't have to write for yourself. -
Oracle Releases Struts / BC4J Toy Store Demo and Whitepaper[ Go to top ]
- Posted by: Steve Muench
- Posted on: May 01 2003 12:38 EDT
- in response to Eric Ma
Eric,
BC4J is not open source, but we do provide source for all of our client-side frameworks (JClient, JSP Data Tags, and BC4J/Struts integration). Any J2EE apps built with BC4J can work with any J2EE app server, and you can use BC4J to work with Oracle, SQL*Server, DB2, OracleLite, and other databases, too.
Many external customers use BC4J (as well as our own internal teams), and the framework's many of design pattern implementations and rich set of application-building features and tools reflect the experience of these users who have helped us continuously improve the framework since 1999 when we first went production. Customers are building both JSP and Swing apps (those web apps, both with and without Struts).
If your perception is that BC4J only targets persistence, then I'd encourage your to read of Simplify J2EE Development with the Oracle BC4J Framework and Building a Web Store with Struts & BC4J Frameworks which try to explain the full breadth of J2EE design patterns and application building features that we provide for you. Persistence is only a very small slice of what features are required to build real-world apps, and we go way beyond that for you.