Feed aggregator

Hotsos Symposium 06

Scott Schwab - Fri, 2006-03-03 16:04
I will be in Dallas next week, attending the Hotsos Symposium and a training session on the Cost Base Optimizer. This is my first time to this conference, but it sounds like it will be fun. Others have blogged what session they are attending, but I am not sure yet. I do know I want to hear the talk on CBO's Costing Of PL/SQL Functions and End-to-End Performance Diagnosis in Oracle.Cool cool Scott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

QUTE and Oracle XE

Scott Schwab - Fri, 2006-03-03 09:02
Last night I loaded Qute 1.0.4 onto a fresh version of Oracle XE. I did get it to work, but needed to do the following:Install utl_file into Oracle XE. This can be done by running the RDBMS\ADMIN\utlfile.sql as the sys user.After using the Qute installer, one important package body would not compile QU_DESCRIBE. I ended up going into the package body and stubbing out the procedures which are Scott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

How we're going to fix JSF state saving

Adam Winer - Thu, 2006-03-02 11:16
State is not bad. Statelesness is not good. State is your friend. But like a bad friend, State can sometimes hang around the house, eating your Mitchell's ice cream and drinking your Amarula 'til he gets fat and lazy, turns your house into a pig sty, and makes you wonder why you ever were friends with him in the first place.

JSF state is kind of like that. As I've said in a previous post, JSF state saving is way too hefty and saves far too much that doesn't need to be saved in the first place. So, here's my 5 step plan for fixing that.

Step 1
1. Use Facelets.

Step 2
2. Enhance the ADF Faces FacesBean API to support a "delta" mode - call a new markInitialState() method on it, and its saveState() implementation only saves all the changes made since markInitialState(). And if there's no changes, just return null. (You can't easily do this without FacesBean; see my earlier post on the subject.)

Step 3
3. Update the ADF Faces Facelets TagHandlers to call markInitialState() after creating the components.

Step 4
4. Implement Jacob Hookom's idea to save the tree of component state in a Map, not a gigantic Object array hierarchy.

Step 5
5. Rewrite the Facelets restoreView() implementation to recreate the tree from scratch in its original state, then call restoreState() on each component from the Map we built up in step 4.

And done. You don't need to save the tree structure anymore - Facelets is handling that by recreating the tree from its cached TagHandlers. And since most components don't actually change - unless you explicitly set properties on them - most components don't have to save any state.

(P.S.: there's some trickiness here that I'm ignoring: if you add components dynamically to the hierarchy, you do have to save their state and structure, since it's not present in the page. That's one reason why I strongly recommend making all dynamically created components transient if you have any choice in the matter, but that's a subject for another post.)

RAC on VMware

Wijaya Kusumo - Tue, 2006-02-28 20:15
There is an interesting article by Tarry Singh about Installing Oracle 10gR2 RAC on VMware. With VMware Server are being offered for free, I believe there will be more and more instances of Oracle running on VMware. But do we really want to have RAC on VMware? Perhaps I will use it for demo and learning purposes, but not in production system. To me, nothing beats the real stuff. VMware

Free Free Free

Scott Schwab - Tue, 2006-02-28 19:08
As reported everywhere, Oracle XE is now out and available. Add this to SQLDeveloper, Qute and you can do some rock solid PL/SQL programming for free.Scott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

SQLDeveloper Export package file parsing

Scott Schwab - Sun, 2006-02-26 21:22
In my last post, I talked about the latest SQLDeveloper from Oracle, including a way to export all my packages in a single step, with their Tools->Export option. I had a Python script that did part of the job of breaking the outputted file into seperate files for package body and spec. Tonight, I reworked part of Python script, and then though I share it. Be warned, very little testing hasScott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com3

SQLDeveloper EA 5

Scott Schwab - Sun, 2006-02-26 11:04
On OTN, Oracle has just released the fifth early adaptor version of SQL Developer (1.0.0.13.43). Going by the release notes, it fixed some bugs in the SQL Worksheet, UNICODE, and startup time.So far my favorite new feature, is the Tools->Export tool, which allows you to create a file of DDL and PL/SQL packages. This is great, as I end up writing lots of PL/SQL and leaving it in the databaseScott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

Potential pitfall with Oracle Sequence

Wijaya Kusumo - Fri, 2006-02-24 00:44
Robert Vollman talks about Oracle sequences in his blog. Basically there are 3 potential issues with Oracle sequences that we need to consider when doing db design: 1. The squence number may "jump", that is 1,2,3,5,6,8,... with number 4 and 7 missing. One reason is if you do a transaction with NEXTVAL and then rollback, the sequence doesn't roll back to where you started. 2. By default,

A Simple Dual

Scott Schwab - Thu, 2006-02-23 20:14
What happens when this sql is called, but the tag you are looking for, is not in the XMLTYPE? SELECT extractvalue(my_xmltype, my_xpath_to, my_namespace) FROM dual; (1) Raise no data found exception (2) Returns null Answer: (2) returns null, so if you want to check to see if the text node exist for a x_path, don't expect a EXCEPTION clause to check it.Scott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

Usability problems in JSF

Adam Winer - Tue, 2006-02-21 14:10
JSF is not perfect, nor the greatest thing since sliced bread. There, I said it!

What bugs me most (and remember, I'm still a big fan) is that JSF was supposed to be really easy-to-use. In many ways, it is very easy. But the reality isn't always quite so sweet. There's shortfalls that make the learning curve longer than it should be, and they are fixable.

The most annoying problem is that errors simply result in big stack traces. There's nothing wrong with stack traces per se, but by themselves they're totally insufficient for error diagnosis. Real diagnosis requires at a minimum:

  • Line and column numbers, as well as file name. And even better, the snippet of content from that document that matches up.

  • If an EL expression fails, information on what part of the EL expression failed. (When a complicated expression like #{foo.bar.baz == my.other.expression} fails, it's very hard to figure out what went wrong.)

In general, all exceptions thrown anywhere in JSF or JSPs should be vetted to ensure that they:
  • Contain a meaningful, useful error message
  • Contain enough context to point out what bit of user content failed
  • Never, ever drop the base error, if one is being wrapped
A second category of annoyances in JSF consist of "nothing happened" problems. For example, if a validation error stops you from going on to Invoke Application, but you've forgotten to add an tag or something similar to your page, all that you see is - nothing.

Finally, when you do figure out what you've done wrong, quite often you need to bounce the server to pick up the changes. Any changes to WEB-INF/faces-config.xml require this. That's a huge productivity hit.

So, that's my hit list for JSF usability problems. What are your biggest JSF usability concerns?

[PS: Yes, I edited the wording a bit. It was coming across as an angry rant that JSF isn't useable, which isn't where I'm coming from.]

first post

Scott Schwab - Mon, 2006-02-20 21:06
Hello worldScott Schwabhttp://www.blogger.com/profile/14014003619353346507noreply@blogger.com0

What is SASH anyway?

Omar Tazi - Thu, 2006-02-09 19:03
One of the challenges most people I talk to have in dealing with OSS is integrating projects that were designed to work together. Many people are trying to use Struts with Hibernate and/or Spring with Hibernate and end up having integration problems…The reality is that enterprises run open source and commercial software side-by-side and will continue to do so. That’s why Oracle partnered with SourceLabs to solve this issue for Oracle AS 10g customers. SASH simply means (Struts, Apache Axis, Hibernate and Spring). SourceLabs provides services around their tested SASH stack. Oracle customers using server-side Java are now able to improve productivity, reduce operational risk, and adopt open platforms with confidence.

I find this exciting and it’s inline with Fusion Middleware’s Hot-Pluggable message (believe me it’s not just a marketing buzzword) which essentially means that we are willing to compete on industry standards and if you find a module that works better than one of the components in the Oracle stack, you can seamlessly swap it out with the equivalent module of your choice. Oracle’s middleware is engineered to work well with third-party products, including open source and IBM's WebSphere line.

To get more information and even download SASH for Oracle AS 10g, go to the SASH section on OTN.

What is SASH anyway?

Omar Tazi - Thu, 2006-02-09 19:03
One of the challenges most people I talk to have in dealing with OSS is integrating projects that were designed to work together. Many people are trying to use Struts with Hibernate and/or Spring with Hibernate and end up having integration problems…The reality is that enterprises run open source and commercial software side-by-side and will continue to do so. That’s why Oracle partnered with SourceLabs to solve this issue for Oracle AS 10g customers. SASH simply means (Struts, Apache Axis, Hibernate and Spring). SourceLabs provides services around their tested SASH stack. Oracle customers using server-side Java are now able to improve productivity, reduce operational risk, and adopt open platforms with confidence.

I find this exciting and it’s inline with Fusion Middleware’s Hot-Pluggable message (believe me it’s not just a marketing buzzword) which essentially means that we are willing to compete on industry standards and if you find a module that works better than one of the components in the Oracle stack, you can seamlessly swap it out with the equivalent module of your choice. Oracle’s middleware is engineered to work well with third-party products, including open source and IBM's WebSphere line.

To get more information and even download SASH for Oracle AS 10g, go to the SASH section on OTN.

Is this where OSS is going?

Omar Tazi - Wed, 2006-02-08 20:48
When I saw this deal today I thought it summarized pretty well where open source seems to be going. The news in itself is not very exciting but it’s yet another open source startup raising a pretty good round from top tier VCs. In a nutshell, Alfresco which offers a document management platform raised an $8M series B investment round from Mayfield and Accel (which had already led round A). This confirms that:

- Open source is more professional. Open source developers are not what they used to be (midnight hackers working from their garage). More often than not, open source developers today are professional developers employed by large vendors (like Oracle or IBM) or well-funded startups like Alfresco or Spikesource (backed by Kleiner Perkins). Additionally large vendors offer professional support for open source projects (for example Oracle, IBM, Novell and HP support Linux).

- Open source is (slowly but surely) moving up the stack. First, the debate is not limited to Linux vs. Windows anymore. Also, the target open source end user profile is changing as open source moves up the stack. With Linux and Eclipse, typical users are system administrators and developers. Open source is moving beyond infrastructure software and tools into different areas with various degrees of success. Alfresco seems to be doing a good job in document management and Asterisk seems to offer a very popular PBX/VoIP telephony system (I am a happy Asterisk user without knowing much about PBX systems).

Is open source ready for ERP or CRM? Those of us who have been around a while in this industry know full well that VCs are not always right but in the last 18 months they have been very active investors in open source based startups with services-based business models. Time will tell if they were on the money! Let's not get too excited for now I don’t see traditional commercial software going anywhere anytime soon.

ADF Faces and JSF 1.2

Adam Winer - Wed, 2006-02-08 00:55
JSF 1.2 is right around the corner, and, of course, ADF Faces is going to be right there too, right? Well, not so fast...

ADF Faces took one fairly unusual approach in designing its components. Instead of extending the standard UIComponentBase class like almost everyone else does, we directly extended UIComponent with UIXComponentBase. I chose this path for good reasons - like the FacesBean state saving approach I blogged about a few posts down - but it does carry a penalty. When UIComponent changes, ADF Faces breaks. And UIComponent does change in JSF 1.2. In particular, the move from the JSF EL to the new Unified EL means new getValueExpression() and setValueExpression() methods.

C'est la vie.

So, here's the good news: I'm promising, right here and now, to get a version of ADF Faces out soon that will be based on JSF 1.2. There's one big question to resolve: should it be based on the code in JDev 10.1.3, or on the post-10.1.3 code we're donating to MyFaces? I'm leaning towards the latter, but let me know if you feel differently.

What belongs in the JSF standard?

Adam Winer - Mon, 2006-02-06 15:29
As the Expert Group starts working on JSF 2.0, we're faced with a very fundamental question: how do we pick and choose what belongs in the standard? And what, by contrast, does not belong in the standard?

There are several reasons why something should go in the standard:


  1. Feature ABC cannot be implemented outside of the standard.

  2. Feature DEF is not directly needed by the standard, but promotes interoperability.

  3. Standards receive better tool support, and tool support is essential for feature XYZ.



Some examples of each:


  1. JSF Avatar requires support from UIComponent, and therefore has to go into the standard.

  2. The DataModel API allows interoperability between different model providers and component providers. It would be helpful if JSF had a TreeModel for the same reason - instead of everyone inventing their own TreeModel, we can have one abstract interface that lets model experts provide the best implementations possible and component developers design the best tree UIs around.

  3. Facelets would benefit from tool support (Creator, JDeveloper, etc.)



But if you don't meet these standards, why not still add the feature to JSF? Why not add a calendar component? How about a declarative framework that makes it easy to create renderers? Or support for XSLT post-processing of content? These all seem like handy features, but I feel strongly that none belong in the JSF standard yet. A J2EE standard has very difficult constraints placed on it. The long development cycle means we only get to add features occasionally. But we're also required to maintain backwards compatibility, so fixing mistakes is difficult-to-impossible. So, here's a list of some reasons why not to add something to the JSF spec:


  1. Feature ABC can be implemented just as easily outside of the spec as inside of it. That is, the current public API is entirely sufficient to implement the feature.

  2. Feature DEF is not yet well understood - there are multiple possible directions to head. The JCP process works best when it standardizes existing best practices.

  3. Feature XYZ is of only limited use - not everyone needs it.



These are not at all mutually exclusive lists. For example, the Avatar API is not the last word in handling AJAX requests for JSF. A declarative framework for renderers can be implemented outside the spec, but it would benefit from more tool support. And so forth.

Perhaps the most difficult task of any framework developer is learning how to say "No". As in, "No, we don't want that feature." But that is absolutely our responsibility as architects of JSF.


It's down there somewhere, let me take another look...
-- The Big Lebowski

Checking Redhat version installed

Wijaya Kusumo - Sun, 2006-02-05 23:55
I was looking at how to tell the version of Redhat Linux installed on a machine from a command line. Mostly I used uname -a to view the server settings.   Here is a sample: $ uname -a Linux myserver.mydomain.com 2.4.21-32.ELsmp #1 SMP Fri Apr 15 21:17:59 EDT 2005 i686 i686 i386 GNU/Linux It return the server kernel's version: 2.4.21-32.ELsmp, but not something my mother could understand.

Inception of ADF NOOB

Casper Bang - Thu, 2006-02-02 09:32
Welcome to my blog which will revolve primarily around real-word development issues using Oracle's JDeveloper IDE and their Application Development Framework (ADF). It is my attempt to communicate what I have learned to peers and in the process hopefully gain a better understanding myself.

What?
ADF is vastly different than traditional web application development as well as other 4/5GL frameworks. It introduces an enterprise development infrastructure unlike most other, with a shift towards a highly declerative paradigm which encapsulates all parts of a J2EE application. ADF and the associated IDE, JDeveloper, relies on a complex stack of associated tier technologies and as such, is not the easiest to get started on without feeling that you are drowning in complexity. This blog will deal primarily with Apache Struts as the controller tier and Oracle UIX as the view tier, running on top of Oracle 10g.

Why?
While ADF and its associated tier technologies are definately not as easy to get started on as classic server side scripting with embedded PL/SQL nor other frameworks (Rails, Spring etc.), it constitutes the higher learning curve in the long run by addressing application issues on a large scale such as maintenance, service orientation and rapid application development (RAD). In a testiment to this, in a recent development contest Oracle ADF took home the gold and silver medal for being the most productive RAD framework. While neither JDeveloper nor ADF is open source, it is completely free to use and applications can be deployed to any J2EE-compliant application server. On a personal note, ADF is about the only framework I've come across, which allows a composite/joined table view to get its related (detail) table updated as well as the primary (master) table by means of the framework!

Why not?
As already mentioned, in order to benefit from the ADF framework you really must be willing to put in a substantial amount of time before you can expect to develop any real-world applications. On a more subtle note, realize that while ADF is at a fairly mature state as of JDeveloper 10.1.2; tools, documentation and community support might be sub bar compared to what you are used to in other development environments and frameworks. And finally you should also be aware, that standards and next-generation technologies will append or replace ADF and currently associated tier technologies. For example, the next version of JDeveloper (10.1.3) introduces a new view and controller framework known as Java Server Faces (JSF). Developer Joel Spolsky has an entertaining analogy to the complexity of frameworks.

How?
ADF encapsulates many J2EE patterns within its framework, including the infamous MVC pattern. From top to buttom, a typical ADF application can be though of as having 4 tiers.



The view tier which is where all the UI rendering happens, a controller tier which handles navigational aspects and a model tier where data is bound to the final tier; the Business Service tier.
These Business Services are at the very core of ADF and this is where you will find the applications point of entry, known as the Application Module (AM). To uptain a detailed understanding of how the underlying binding layer works, Oracle publishes an up-to-date ADF Data Binding Primer.
Categories: Development

The Model: AM, Entities, Views etc.

Casper Bang - Thu, 2006-02-02 09:27
As already mentioned in my first blog entry, ADF is composed by a multitude of layers within a large technology stack and these can be abstracted into the MVC pattern. In reality, the View and Controller layer in ADF is collapsed into the same layer and this is why most ADF applications actually consist of 2 independent projects within one ADF application, namely the Model and the ViewController. The following provides a quick and rudimentary explanation to what you will find in the Model part of such an application.

Application Module (AM)
This is your applications point-of-entry and essentially responsible for launching and managing the data-model beneith your applcation. Whichever Views and ViewLinks you may have created will not have any effect (be visible) before they are added to the AM. The default implementation of the AM is in ApplicationModuleImpl.java which will have a main method for launching a default Swing test application which can come in very handy when debugging and testing your model layer. You may extend the default implementation, as is often nessesary, in order to satisfy various pre-condtions such as user authorization etc. For example, to lock a specific view (E.g. UserView) to only show records with the users own initials (CLB in my case), the following could be done:

protected void prepareSession(Session session)
{
super.prepareSession(session);
this.getUserView().setWhereClause("UserView.initials = :initials");
this.getUserView().setWhereClauseParam(0, "CLB");
}


Whichever view is linked to the UserView, will "inherit" this limitation and thus provides an excellent way of ensuring users see only their related rows. This could not have been achieved by a pure static view since the view is dynamic by nature, adapting to whichever is signed in to the system.

Entity Objects
Entity objects are at the very heart of an ADF application and its responsibility is to encapsulate a database table (and its rows). The framework will require there be a primary key column before doing so, the reason for this will be obvious in a moment. A java representation instance is required in order to model layers on top and add business logic. ADF can overide the default Java representation for an Entity and expose type-safe accessor methods for
association attributes rather than the default getAttribute("
"). In JDeveloper an entity has both an instance (.java file) and related metadata (.xml file).

Associations
Handles relation and cardinality between two entity objects. These attributes allow you to navigate from one entity instance to either another entity instance or a collection of related instances, depending on the cardinality of the association in question. This can be done by using
getAttribute("
") where the framework will use the association to perform a findByPrimaryKey() on the related table and fetch the data for you. Associations are paramount to making views over multiple Entities, by using the association information to automatically construct the underlying join (WHERE clause). Associations are just metadata for the entities, stored in corresponding XML files.

View Objects
In the simplest sence, a view is nothing more than a SQL query. However, even if a view is composited over multiple Entity objects, it can be updated just as if it was an atomic table in the database. This is done providing the "reference" attributte for the Entity object is checked and is what distinquishes an ADF view from a database view.

ViewLinks
Handles relation and cardinality between two view objects. ViewLink's connect two views in a Master-Detail fashion, where the master view provides an overview og more detailed data, usually as a 1:* relation between views. When a ViewLink is created between two views, the newly linked attributtes become available to each view.

Categories: Development

Should JSF go stateless?

Adam Winer - Tue, 2006-01-31 16:12
Jacob Hookom's written an interesting blog entry about whether JSF could go stateless. The two of us have gone back and forth on this on e-mail a bunch of times, and I guess you could say that I fall in the "UI state is a good thing" camp. In large part, that comes from all the time I've spent working on component frameworks.

I absolutely agree with Jacob on one of his points - "Statesaving in JSF is [really] bad in implementation". It's a massive and heavyweight "save everything on the page" approach that is, at least conceptually, horrible overkill. For example, it's ridiculous that we have to save the UI component hierarchy, attributes, EL expressions, etc., when we have a JSP or Facelets document containing exactly that information just sitting there on the server. Even though I know why this happened - JSF had to support JSPs, etc., etc. - it's a very frustrating state of affairs.

Nevertheless, I think throwing out state saving altogether in response would be going too far. It'd be like saying that you should never bother sorting because Bubble Sort is a really slow algorithm. Unfortunately, JSF, as designed today, makes it very difficult to even attempt to optimize state saving. Until there's a really sane, solid implementation of state saving, any big policy decisions are premature.

The real problem with optimizing JSF state saving is the way that UIComponent.saveState() (and restoreState()) is typically implemented. Each class is responsible for saving all of its own per-instance state, up and down the hierarchy. So UIComponentBase stores its properties in an array, then UIOutput stores a few more properties (plus the UIComponentBase state) in an array of its own, then UIInput aggregates its own state, and finally HtmlInputText adds its own. For example, here's the start of HtmlInputText.saveState():


public Object saveState(FacesContext _context) {
Object _values[] = new Object[31];
_values[0] = super.saveState(_context);
_values[1] = accesskey;
_values[2] = alt;
_values[3] = dir;
_values[4] = this.disabled ? Boolean.TRUE : Boolean.FALSE;
_values[5] = this.disabled_set ? Boolean.TRUE : Boolean.FALSE;
.... and on and on and on for another 26 lines ....
}


Nasty! If a container wanted to optimize state saving, it'd somehow have to mix that in not just into one class, but into every component class up and down the hierarchy.

ADF Faces took a different approach. We store all of our component state in an FacesBean instance. It takes care of storing simple properties, ValueBindings, lists (like listeners and validators), and knows how to save and restore state. Here's the full code for UIXComponentBase.saveState();


public Object saveState(FacesContext context)
{
return getFacesBean().saveState(context);
}


And subclasses don't neeed any code at all. Aaahhhh..... Now that's better. More on FacesBean in a later post (there's a lot of other advantages), but what's relevant is the general principle: all state saving is implemented up in the base class, so now there's a hook to implement real cross-cutting optimizations like:


  • Cache reusable FacesBean instances on a Facelet tag handler (with copy-on-write), especially for panels and output components that rarely if ever mutate

  • Implement saveState() that only saves deltas from the original state of the bean (and rely on Facelets to recreate the tree in its original state)



Secondarily, we'd do very well to follow Jacob's advice and re-think how processSaveState() and processRestoreState() function - instead of creating a deep heirarchy, create a flattened Map or array structure.

Implement all of this, and then we're in a place to judge whether fully stateless UIs are necessary. I think they will be, for some limited types of applications, but JSF can be pushed a lot further than it's going now.

Pages

Subscribe to Oracle FAQ aggregator