Monday, October 31, 2005

Hibernate Pagination

Compatible with Hibernate 2.1.8, easily adaptable to 3.

Last rewritten on May, 2005, by Pietro Polsinelli.

I propose here a pagination solution, which took as starting point what can be found in hibernate team weblog. It is structured in an interface, Page, and two implementation classes:

* HibernatePage: uses the method suggested in the guide to feed the page. Has a (sample) factory method,

public static HibernatePage getHibernatePageInstance(Query query,
int page Number,
int pageSize,
String driverClass)

that in base of the driver class returns a HibernatePage that gets the total elements by scrolling, for databases that support scrollable resultsets: not many do it really (see below). For jdbc drivers that do not support scrollable resultsets, finally I just did query.list().size(). This can be optimized in particular instances; in general, a Hibernate user proposed "I was planning on converting the Hibernate query to SQL and then replacing the 'select .... from ...' with 'select count from ..' to get the real count'" but in order to make it work in all cases, you have to take into account that you may be returning arrays of objects, hence you have to modify the Hibernate query, which is not trivial. In fact I did some testing on Oracle 10 with driver 10, and the way it is done in the sample code, using query.list().size() resulted FASTER than the count(*) done in sql!

If you seriously consider performance, real problems are got by making wrong joins, forgetting to index columns and so on, where you may get multiplicative groth of required times. If anyway you are troubled by this, you can use proprietary sql tools (in particular in case of Oracle) to develop an OraclePage that avoids even that (assuming that Oracle will not release support for real scrollable resultsets): see the paragraph on Oracle below.

more...
code...
--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com

Onjava Article: 'AJAX: How to Handle Bookmarks and Back Buttons'

Posted by: Joseph Ottinger on October 27, 2005 @ 08:32 AM

OnJava has published an article by Brad Neuberg on handling the back button and bookmarking in an AJAX application . These two issues are some of the most often cited problems with AJAX outside of application design. The article covers the use of the "Really Simple History" library to provide workable functionality for AJAX.


http://feeds.feedburner.com/techtarget/tsscom/home?m=221




Monday, October 24, 2005

H@ppy birthday to you

To most of us, electronic mail is a relatively recent phenomenon. But the first e-mail was sent 34 years ago, after a programmer came up with the "@" symbol format for e-mail addresses....,more..

uncover the hood of J2EE clustering

More and more mission-critical and large scale applications are now running on Java 2, Enterprise Edition (J2EE). Those mission-critical applications such as banking and billing ask for more high availability (HA), while those large scale systems such as Google and Yahoo ask for more scalability. The importance of high availability and scalability in today's increasingly inter-connected world can be proved by a well known incident: a 22-hour service outage of eBay in June 1999, caused an interruption of around 2.3 million auctions, and made a 9.2 percent drop in eBay's stock value.

J2EE clustering is a popular technology to provide high available and scalable services with fault tolerance. But due to the lack of support from the J2EE specification, J2EE vendors implement clustering differently, which causes a lot of trouble for J2EE architects and developers. Following questions are common:

  • Why are the commercial J2EE Server products with Clustering capabilities so expensive? (10 times compared with no clustering capabilities)
  • Why does my application built on stand-alone J2EE server not run in a cluster?
  • Why does my application run very slowly in a cluster while much faster in non-clustered environment?
  • Why does my cluster application fail to port to other vendors' server?

The best way to understand the limitations and considerations is to study their implementations and uncover the hood of J2EE clustering.

http://www.theserverside.com/articles/content/J2EEClustering/article.html




Wednesday, October 19, 2005

Get a better handle on Struts actions, with Spring

Level: Intermediate

George Franciscus ( george.franciscus@nexcel.ca), Principal, Nexcel

Struts Recipes co-author George Franciscus is back with another great Struts integration recipe -- this time for importing Struts applications into the Spring framework. Follow along as George shows you how to revamp Struts actions so they can be managed just like Spring beans. The result is a boosted web framework that easily reaps the benefits of Spring AOP.

more..





Sun-Google: Where's the Beef?



Eric Lundquist  

By Eric Lundquist


Opinion: After Google and Sun held a press conference, the buzz was overpowering, and sometimes that is all that is required to move markets, shake the competition and get customers to consider new alternatives.


Once, when mainframes ruled the Earth, IBM could make or break its competitors by merely mentioning the name of the next generation of big iron. The early announcement of a new mainframe could freeze the entire market as customers held off purchasing or leasing any new boxes until the next IBM system appeared. A simple price change would roil the market for months. It was indeed the time when dinosaurs ruled.


more..
--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Article: The Power of JAAS: Security System Alternatives

Posted by: Regina Lynch on October 18, 2005 @ 11:40 AM

In this article, Frank Teti shows us how to architect for RBAC within an environment centered on J2EE using a TAI.

J2EE security is still all about application-bound authorization and authentication not perimeter security. However, in a highly distributed J2EE architecture, the evolving Java 2 Security “Sandbox Model”, including Java Authentication and Authorization Service (JAAS) 1.0 plus vendor extensions is essentially a ubiquitous, enterprise-wide security model.

The power of JAAS is in its ability to use almost any underlying security system, such as, the local operating system, LDAP, RACF or Oblix NetPoint. Increasingly, one of the more popular alternatives is to use a Trust Association Interceptor (TAI). A TAI provides support to J2EE resources for role-based access and user-based single sign-on and is becoming one of the more popular alternatives.

Read "The Power of JAAS: Security System Alternatives"


Ajax using XMLHttpRequest and Struts


by Frank W. Zammetti

 About five years ago I worked on a web app project where one of the primary requirements was that it should look, work and feel like a Windows-based fat client.  Now, ignoring the question of why it was not in fact done as a Windows-based fat client in the first place, that can be a rather tough requirement in the world of web development, certainly it was five years ago when not very many examples of such a thing existed.

 

As a result of a number of proof-of-concepts, I stumbled upon some techniques for doing things that were at the time rather atypical approaches to web development.  The end result was an application that, to this day, many people cannot even tell is web-based, aside from the fact that you access it with a browser!

 

Little did I know that only a few years later the basic concepts behind what I had done would re-emerge in the world as something called Ajax.  Ajax is a term coined by the folks at Adaptive Path and is shorthand for Asynchronous Javascript + XML. 

 

This just goes to show, patenting every idea you ever have is indeed a good way to riches!  If only I would have thought what I did was anything special!  But I digress…

 

Google is doing it.  So are many others.  But what is it?  In a nutshell, the Ajax concept, which is not a concrete technology implementation but rather a way of thinking and a set of techniques that go along with the mindset, is concerned with the idea that rebuilding a web page for every user interaction is inefficient and should be avoided.



more...


Tuesday, October 18, 2005

Object pooling is now a serious performance loss


Posted by: Frank Charles on October 17, 2005 @ 03:29 PM

Brian Goetz continues to lift the lid and peak into the inner workings of Java in Java Urban Performance Legends . In this article he exposes the fallacy behind some of the more common performance myths found in the annals of the JVM.

The article takes a deep look at memory management has improved over the years and how this improvement has invalidated many of the techniques that developers generally believe help performance. The article winds up an explanation of escape analysis and how this technology will further improve the JVMs ability to manage memory.

Is the JVM technology fast enough for you or does you JVM cause you performance grief?


http://www.theserverside.com/news/thread.tss?thread_id=37146

Blackboard, WebCT combining forces

The top two providers of learning management system (LMS) software and services for higher education, Blackboard Inc. and WebCT Inc., have announced an agreement to merge. The merger would leave the combined entity with more than 80 percent of the LMS market share in higher education, which includes the software platforms that drive online learning. The impending deal has a price tag reported to be approximately $180 million.

more..


A Glimpse at the Future of Programming Languages O'Reilly Releases "Beyond Java"

The auther looks at other languages and frameworks and asks hard questions: What do these languages do better? Could any of them become the next "big new thing?" What will the tools of the future look like? Will they look like J2EE, or will they look like Ruby on Rails? Or, will they be even more radical, like continuation servers? In addition to his own insights, The Auther includes interviews with leaders of the open source Java and Ruby communities: Glenn Vanderburg, Ted Neward, Justin Gehtland, James Duncan Davidson, David Heinemeier Hansson, Jason Hunter, and many others.

more...


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Monday, October 17, 2005

Ajax: A New Approach to Web Applications

by Jesse James Garrett

February 18, 2005

If anything about current interaction design can be called "glamorous," it's creating Web applications. After all, when was the last time you heard someone rave about the interaction design of a product that wasn't on the Web? (Okay, besides the iPod.) All the cool, innovative new projects are online.

Despite this, Web interaction designers can't help but feel a little envious of our colleagues who create desktop software. Desktop applications have a richness and responsiveness that has seemed out of reach on the Web. The same simplicity that enabled the Web's rapid proliferation also creates a gap between the experiences we can provide and the experiences users can get from a desktop application.

more...


reference:  http://en.wikipedia.org/wiki/AJAX


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Thursday, October 13, 2005

MS IE Developer Toolbar


The IE Developer Toolbar provides several features for deeply exploring and understanding Web pages.


-- Explore and modify the document object model (DOM) of a web page.
-- Locate and select specific elements on a web page through a variety of techniques.
-- Selectively disable Internet Explorer settings.
-- View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
-- Outline tables, table cells, images, or selected tags.
-- Validate HTML, CSS, WAI, and RSS web feed links.
-- Display image dimensions, file sizes, path information, and alternate (ALT) text.
-- Immediately resize the browser window to 800x600 or a custom size.
-- Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
-- Choose direct links to W3C specification references, the Internet Explorer team weblog (blog), and other resources.
-- Display a fully featured design ruler to help accurately align objects on your pages.


The Developer Toolbar can be pinned to the Internet Explorer browser window or floated separately.


http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&displaylang=en


Tuesday, October 11, 2005

My Frist Book Review At Amazon

Jakarta Struts Cookbook
By Bill Siggelkow


Publisher : O'Reilly
Pub Date : February 2005
ISBN : 0-596-00771-X
Pages : 526



Good Struts meal cooked by Bill Siggelkow

This book has a very strong collection of common and day to day programming problems with struts.Topics varied from introductory topics like (installation , Configuration , User Interface) to Advanced topics like (Lazy Dynamic Forms,Exception handling , Security , Tiles).
Every Chapter in this book provide smart solutions for common problems faces the developers.
The solutions usually provide a shortcut way for solving with deep discussion for every solution.
The books has about over 130 problems.Each problem has a smart solution with clear and deep discussion.
I think this is the most effective way to transport working experience.
I'm 2 years struts developer.
Personally I enjoyed the discussion of Hibernate and Spring usage with struts.I gained new and good information about the new struts version 1.2.
I think this book will be very useful for any struts developer who wants to absorb the others experiences for old faced problems or new ones.

http://www.amazon.com/gp/product/059600771X/103-1785054-2401400?v=glance&n=283155&n=507846&s=books&v=glance

Wednesday, October 05, 2005

Sun, Google to Partner on Software

MOUNTAIN VIEW, Calif.—Sun Microsystems and Google on Tuesday announced a partnership that will see the two Silicon Valley firms distribute and promote each other's software technologies.

Under the agreement, the two firms will explore opportunities to promote and enhance Sun technologies like the OpenOffice.org desktop productivity suite and the Java Runtime Environment.


http://www.eweek.com/article2/0,1759,1866941,00.asp?kc=EWRSS03119TX1K0000594


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Monday, October 03, 2005

Hotmail Story



http://arab.moheet.com/asp/show_f2.asp?do=1437833


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Open Source Becomes Key Player in Business Models

What will become of open-source companies when they grow up? Will there be an open-source dot bomb, or is the investment going into open source leading the way for a whole new kind of software company?

Although the jury is still out, it is evident open-source software has and will continue to impact the software industry and the business models of new and existing companies, as both start-ups and large entrenched players vie to keep ahead of open-source projects.

http://www.eweek.com/article2/0,1895,1866023,00.asp


interview with Fleury: JBoss' Model Is 'Here to Stay'

Q&A: Marc Fleury, CEO of JBoss Inc., talks about how he sees startup companies like his competing with entrenched vendors such as IBM.
Marc Fleury, CEO of JBoss Inc., said open source is a force to be reckoned with and that his company's version of "professional open source" will be one of the prominent forms of software development as the industry shakes out. Fleury sat down with eWEEK senior editor Darryl K. Taft to talk about how he sees startup companies like his competing with entrenched vendors like IBM, which acquired Gluecode Software, a JBoss competitor, last May.

http://www.eweek.com/article2/0,1895,1866202,00.asp



--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



PostgreSQL Features

PostgreSQL has benefited well from its long history. Today, PostgreSQL is one of the most advanced database servers available. Here are a few of the features found in a standard PostgreSQL distribution:

  • Object-relational In PostgreSQL, every table defines a class. PostgreSQL implements inheritance between tables (or, if you like, between classes). Functions and operators are polymorphic.

  • Standards compliant PostgreSQL syntax implements most of the SQL92 standard and many features of SQL99. Where differences in syntax occur, they are most often related to features unique to PostgreSQL.

  • Open source An international team of developers maintains PostgreSQL. Team members come and go, but the core members have been enhancing PostgreSQL's performance and feature set since at least 1996. One advantage to PostgreSQL's open-source nature is that talent and knowledge can be recruited as needed. The fact that this team is international ensures that PostgreSQL is a product that can be used productively in any natural language, not just English.

  • Transaction processing PostgreSQL protects data and coordinates multiple concurrent users through full transaction processing. The transaction model used by PostgreSQL is based on multi-version concurrency control (MVCC). MVCC provides much better performance than you would find with other products that coordinate multiple users through table-, page-, or row-level locking.

  • Referential integrity PostgreSQL implements complete referential integrity by supporting foreign and primary key relationships as well as triggers. Business rules can be expressed within the database rather than relying on an external tool.

  • Multiple procedural languages Triggers and other procedures can be written in any of several procedural languages. Server-side code is most commonly written in PL/pgSQL, a procedural language similar to Oracle's PL/SQL. You can also develop server-side code in Tcl, Perl, even bash (the open-source Linux/Unix shell).

  • Multiple-client APIs PostgreSQL supports the development of client applications in many languages. This book describes how to interface to PostgreSQL from C, C++, ODBC, Perl, PHP, Tcl/Tk, and Python.

  • Unique data types PostgreSQL provides a variety of data types. Besides the usual numeric, string, and data types, you will also find geometric types, a Boolean data type, and data types designed specifically to deal with network addresses.

  • Extensibility One of the most important features of PostgreSQL is that it can be extended. If you don't find something that you need, you can usually add it yourself. For example, you can add new data types, new functions and operators, and even new procedural and client languages. There are many contributed packages available on the Internet. For example, Refractions Research, Inc. has developed a set of geographic data types that can be used to efficiently model spatial (GIS) data.


for more information see:

Open Source Workflow Engines Written in Java


http://www.manageability.org/blog/stuff/workflow_in_java/view

  • Enhydra Shark Shark is completely based on standards from WfMC and OMG using XPDL as its native workflow definition format. Storage of processes and activities is done using Enhydra DODS.
  • Codehaus Werkflow Werkflow is a flexible, extensible process- and state-based workflow engine. It aims to satisfy a myriad of possible workflow scenarios, from enterprise-scale business processes to small-scale user-interaction processes. Using a pluggable and layered architecture, workflows with varying semantics can easily be accomodated.
  • OpenSymphony OSWorkflow What makes OSWorkflow different is that it is extremely flexible.
  • jBpm jBpm is a flexible, extensible workflow management system. Business processes , expressed in a simple and powerfull language and packaged in process archives, serve as input for the jBpm runtime server. jBpm combines easy development of workflow-applications with excellent enterprise application integration (EAI) capabilities. jBpm includes a web-application and a scheduler. jBpm is a scalable J2EE application.
  • wfmOpen WfMOpen is a J2EE based implementation of a workflow facility (workflow engine) as proposed by the Workflow Management Coalition (WfMC) and the Object Management Group (OMG). Workflows are specified using WfMC's XML Process Definition Language (XPDL) with some extensions.
  • OFBiz Workflow Engine The Open for Business Workflow Engine is based on the WfMC and OMG spec. OFBiz Workflow Engine uses XPDL as its process definition language.
  • ObjectWeb Bonita Bonita is a flexible cooperative workflow system, compliant to WfMC specifications. A comprehensive set of integrated graphical tools for performing different kind of actions such as process conception, definition, instanciation, control of processes, and interaction with the users and external applications. 100% browser-based environment with Web Services integration that uses SOAP and XML Data binding technologies in order to encapsulate existing workflow business methods and publish them as a J2EE-based web services. A Third Generation Worflow engine based in the activity anticipation model.
  • Bigbross Bossa The engine is very fast and lightweight, uses a very expressive Petri net notation to define workflows, does not requires a RDBMS and is very simple to use and to integrate with java applications. Actually, it was designed to be embedded.
  • Taverna The Taverna project aims to provide a language and software tools to facilitate easy use of workflow and distributed compute technology within the eScience community. Taverna is both a workflow enactor and also an editing suite.
  • JFolder JFolder (formerly PowerFolder) contains features critical to many applications - including web pages, workflow, security, persistence, email, file management, and data access.
  • Open Business Engine Open Business Engine is an open source Java workflow engine which supports the Workflow Management Coalition's (WfMC) workflow specifications, including interface 1, also known as XPDL, interface 2/3 known as WAPI and interface 5 for auditing. OBE provides an environment for executing activities in a controlled, centralized environment. OBE supports both synchronous and asynchronous execution of workflows. The primary OBE implementation is based on J2EE.
  • OpenWFE OpenWFE is an open source java workflow engine. It features 3 components, easily scalable : an engine, a worklist and a web interface. Its workflow definition language is inspired of Scheme, a Lisp dialect, though it is expressed in XML.
  • Freefluo - Freefluo is a workflow orchestration tool for web services. It can handle WSDL based web service invocation. It supports two XML workflow languages, one based on IBM's WSFL and another named XScufl. Freefluo is very flexible, at its core is a reusable orchestration framework that is not tied to any workflow language or execution architecture. Freefluo includes extension libraries that enable execution of workflows written in a subset of WSFL.
  • ZBuilder - ZBuilder3 is a second generation of workflow development and management system which intends to be an open source product. It defines a set of standard JMX management interfaces for different workflow engines and their workflows.
  • Micro-Workflow - The micro-workflow framework targets developers who want to separate the control and logic aspects in their programs, thus making them flow independent. A well-factored flow independent application facilitates change because the most frequent business changes translate into process changes, thus leaving the code intact. Flow independence also fosters reuse, because domain objects make fewer assumptions about the control context in which they operate
  • con:cern - con:cern is a workflow engine based on an extended case handling approach. A process is described as a set of activities with pre- and postconditions. An activity is executed when its preconditions are met. It manipulates the process item, thereby creating postconditions. The process flow is determined at run-time. This approach is superior to the conventional process flow approach.
  • Twister - Twister's aim is to provide a new generation, easily integrable, B2B oriented workflow solution in Java, based on the latest specification efforts in this field. The process engine is based on the BPEL business process specifications and Web Services standards.
  • YAWL - YAWL (Yet Another Workflow Language), an open source workflow language/management system, is based on a rigorous analysis of existing workflow management systems and workflow languages. Unlike traditional systems it provides direct support for most of the workflow patterns (http://www.workflowpatterns.com). YAWL supports the control-flow perspective, the data perspective, and is able to interact with web services declared in WSDL. It is based on a distributed, web-friendly infrastructure.
  • Zebra - Zebra is a workflow engine - originally developed to fill in the gaps in some commercial and open source workflow engines. The key differences between it and other workflow systems are able to model all the workflows described in workflow patterns, a GUI designer and Hibernate persistence layer.
  • ActiveBPEL - ActiveBPEL engine is a robust runtime environment that is capable of executing process definitions created to the Business Process Execution Language for Web Services (BPEL4WS, or just BPEL) 1.1 specifications.
  • XFlow2 - Inspired by simple workflow definition language in XFlow developed to improve its implementation. Externalized SQL in iBatis mapping files. Works as embedded workflow engine.
  • Apache Agila - A simple business process management (BPM) product that can be easily embedded in other applications and run on a range of devices, including handheld computers.
  • Antflow - AntFlow is a tool for the automation and scheduiling of data system tasks, including those with complex dependencies and workflow logic. Antflow represents a new approach to simplifying system automation that leverages pipelines of hot folders chained together to perform a given task. Using XML, Antflow associates an automated task, such as data transfer, compression, or encryption, with a directory on the local system. Whenever a file is copied or written into the hot folder, the associated task is executed and the file is moved to the next hot folder in the pipeline for further processing.
  • MidOffice BPEL Engine - MidOffice BPEL Editor (MOBE) is an open-source platform for process orchestration which executes, monitors, adjusts and terminates pre-defined processes). The platform is implemented using J2EE technologies and standards like BPEL, XML and SOAP.
  • PXE - PXE is a modular business process execution engine with support for business processes described in the OASIS Web Services Business Process Execution Language (WS-BPEL 2.0) or in the legacy vendor specification BPEL4WS 1.1. PXE consists of three key components: The process compiler converts a business process in XML form into an expression for the process virtual machine, The process virtual machine "runs" compiled processes and The framework is an abstraction layer that wraps and manages the necessary system-level services (persistence, communication) for the engine.
  • Beexee - Bexee is a BPEL engine capable of executing deployed business processes described in BPEL by orchestrating existing Web Services.
  • Syrup - Syrup can be used to describe the tasks, procedural steps, required input and output information and tools needed for each step in a business process. Syrup provides five basic concepts: Tasks, Links, Workflows, Workers and the WorkSpace. Syrup can overcome the von Neumann bottleneck that stops traditional software systems from scaling. It does this by strictly separating the specification, identification and execution phase of Workflows in a distributed setup. Syrup doesn't follow the more complex standards such as Wf-XML, BPML and XPDL.


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



Linux Gains Lossless Filesystem

An R&D affiliate of the world's largest telephone company has achieved a stable release of a new Linux filesystem said to improve reliability over conventional Linux filesystems, and offer performance advantages over Solaris's UFS filesystem. NILFS 1.0 (new implementation of a log-structured filesystem) is available now from NTT Labs (Nippon Telegraph and Telephone's Cyber Space Laboratories).

http://www.eweek.com/article2/0,1759,1866221,00.asp?kc=EWRSS03119TX1K0000594


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com



BEA adds support to Weblogic for Spring

BEA rearchitected their sample application to use Spring and included this with their "Spring on WebLogic Server kit". In " Spring Integration with WebLogic Server", BEA took a traditional J2EE application using Stateless Session Beans and Struts and rewrote it with Spring using POJOs sans the EJBs. The application employs Spring support for JMS (JMSTemplate), Spring remoting (using JAX-RPC Invoker, Web Services), Spring JDBC support and more.

http://www.theserverside.com/news/thread.tss?thread_id=36884


--
h.o.s.a.m.r.e.d
Be OpeN Mind
--
http://hosamred.blogspot.com