Posts tagged reuse

Kennissessie ADF 11g – Ode aan de Task Flow

ADF 11g staat vooral bekend om zijn rich components waarmee een moderne, interactieve en aantrekkelijke user interface kan worden ontwikkeld. En een beetje om de Data Visualization Components (DVTs) waarmee allerlei geavanceerde grafieken en andere vormen van grafische data-presentatie kunnen worden ingepast in de web applicatie.

Veel minder bekend en zichtbaar is de Task Flow. Terwijl dat uit oogpunt van architectuur en voor een efficiente organisatie van een onvangrijk ontwikkel-project en zeker voor het kunnen realiseren van reuse de belangrijkste vernieuwing is geweest in ADF 11g.

Een TaskFlow is een op zichzelf staande module die zowel code – managed beans, navigation rules – als user interface bevat. Een task flow is bijna een mini-applicatie met mogelijk verschillende schermen, complexe navigatie tussen de schermen en een eigen memory scope. Een task flow kan worden geintegreerd in schermen in de applicatie (en in andere task flows). Het contract daarvoor bestaat uit input parameters en events. Task flows kunnen worden verpakt in libraries en tussen projecten worden uitgewisseld als generieke reusable componenten. Een voorbeeld van dat laatste gebruik van task flows zijn de WebCenter Services.

In deze KC sessie ‘Ode aan de Task Flow’ gaan we kennismaken met de Task Flow. Ook al weet je nog niets van ADF 11g – of al juist een heleboel – na deze bijeenkomst zijn task flows ook jouw vriend. Wel is enige ervaring met JDeveloper en ADF 10g nodig om zinvol deze sessie bij te wonen.

We laten zien – en daar ga je vervolgens ook zelf mee aan de slag – hoe de allereenvoudigste task flow kan worden gemaakt, kan worden gebruikt binnen de applicatie en kan worden uitgebreid met navigatie, eigen beans en input parameters. Dan gaan we een reusable task flow publiceren in een ADF Library en hergebruiken in een andere applicatie. Tenslotte laten we een demo zien van WebCenter Services die dus ook task flows als mechanisme gebruiken. We hebben het voornemen om binnen AMIS ook een collectie reusable task flows te gaan ontwikkelen. Deze sessie is daar het startpunt voor.

Hands-on: de bijeenkomst is gericht op hands-on aan de slag gaan met JDeveloper 11g, ADF 11g en met name de task flows. Breng dus een laptop mee waarop JDeveloper 11g is geinstalleerd

(eventueel downloaden van http://www.oracle.com/technology/software/products/jdev/index.html).

Ga naar http://www.forms2future.com/evenementen-archief om je te registreren voor deze bijeenkomst.

ADF 11g: Debugging Task Flows embedded from ADF Libraries using source code jars

We have been struggling quite a bit with a good approach for modularizing our ADF web applications through the use of (stand alone) Task Flows that are developed in independent projects and assembled into a single Web Application from ADF Libraries. In theory, this is a very structured, decoupled way of developing potentially complex ADF Web Applications – while allowing for reuse. The contextual events mechanism in combination with the task flow input parameters allow definition of a clear interface through which to reuse the task flow. So all seems well.

However, when you try to put this theoretical bliss into actual practice, there are some limitations that you run into. One of the tricky issues we had to deal with is: how can we debug our web application when part of the source of the application is reused from ADF Libraries? How can we put breakpoints in the sources that are part of the ADF Library?

On closer inspection, there seems to be a relatively easy way for doing this – using an additional library definition in JDeveloper that refers to the sources that form the foundation of the ADF Library.

Let’s take a quick look at how this would work:

Read the rest of this entry »

Create, Deploy and Consume an ADF Task Flow with ADF Business Components inside

 

I have discussed ADF Task Flows before in raving terms and with some simple example to prove my point. To be honest, I have never before really digged deep in any article into the use case of creating a bounded task flow that has ADF Business Components inside, deploying it to an ADF Library and reusing that Task Flow from that library in a completely different ADF application. That may not even have Business Components itself. Now is the time to remedy that omission. And also demonstrate how the consumed task flow – originating from somewhere in the Resource Catalog – can be integrated and synchronized with the consuming page.

It is not very difficult, but some steps must be observed to wire it together neatly.

Our objective in this article:

* Create a bounded task flow EmployeesList that uses ADF Business Components (in this particular case to display data from a database table called EMP, you may have hear it mention before)
* Deploy the task flow to an ADF Library to make it reusable in other ADF applications
* Create a new ADF Application in which the task flow EmployeesList  is reused.
 

The steps we go through to accomplish this:

1. Create the Bounded Task Flow

2. Deploy the Bounded Task Flow to an ADF Library

3. Add the ADF Library to the Resource Catalog and then to the consuming application

4. Add the Task Flow to a page and wire it into it.

Read the rest of this entry »

Introduction to ADF reusable task flows – consume a bounded task flow that gets synchronized with input parameter changes

Task Flows are the primary mechanism in ADF 11g for organizing the workload in manageable chunks that can be developed in a decoupled fashion in relative isolation, then merged together in web pages that implement the desired functionality. Task Flows are also one of the key mechanisms for reuse – along with but for other purposes than Page Templates, Page Fragments and Declarative Components. Task Flows are the key vehicle for creating encapsulated, stand alone services with a User Interface that can be consumed in multiple pages in various applications.

Task Flows come with their own managed beans, navigation rules, data binding, user interface – behind a fairly well defined interface which consists of input parameters and input/output events.

A few things that might be added to even improve a little on task flows:
- a structured method for documentation and discovery, something like WSDL or JavaDoc to describe the meaning of the Task Flow and its input parameters
- support for facets through which additional content can be injected into (views of) the task flow
- support for page templates with facets predefined by the taskflow that can be associated with the views of the task flow
- ability to register listeners with a task flow for specific events (the contextual event framework is quite awkward)

In this article a simple example of using the Task Flow mechanism for the creation of a reusable service – text translation – that is developed as a bounded task flow that is deployed in an ADF Library to be reused in potentially many applications and pages.

Read the rest of this entry »

The ADF 11g Area Template – for micro level layout design patterns

 

ADF 11g offers various facilities for reusables. To name a few:

Task Flows provide packaged, self contained functionality that consists of both User Interface and Data Bindings and potentially even some process logic and multi step navigation. Task flows can expose parameters that accept values used to dynamically influence the task flow’s behavior. Task flows do not expose facets (which could be an interesting extension of the task flow mechanism). Task flows can publish events that ADF can propagate to consumers outside the region that consumes the task flow.

Declarative components provide a way of packaging reusable clusters of ADF Faces components – usually a fairly small number – that may define parameters and facets through which a usage of the component can be configured and injected with additional content.

Page Templates are a third reusable – typically used to provide a page with one or more containers to hold the page’s content in combination with a frame that has some boilerplate elements – for example titles, menu-items etc. Page templates expose one or more facets into which the contents from the consuming page is injected. Page templates can also publish attributes through which the consumer can pass information used to influence the templates look & feel. Page templates can use data bound components and will then have their own Page Definition.

This article will focus on the Page Template and will explain why this component is somewhat oddly named.

Read the rest of this entry »

Keeping up appearances with ADF 11g RichFaces – Context Sensitive Styling in a world of imperfect HTML with dynamic PageTemplate and Page Fragment includes

 

You may not necessarily know me for all the useful things I do. I tend to find nooks an crannies in JDeveloper 11g and ADF 11g that are no real use to people doing a real job. However, today I have got something to share that is actually useful. I know this as I ran into a demand for it at a customer I visited today.

In short, the situation was like this: we are creating a web application that needs to have several appearances – not very much alike. The basic functionality – data entry, data display, navigation options – is by and large the same. However, there are substantial differences in the look of these various appearances. And no – it is not just styling or skinning, though that is certainly part of it. What in one appearance maybe located on the top of the page may go right into the center of the page in another appearance. And what in one incarnation maybe a search area with three items, positioned in a horizontal group, all of them plain inputText items may in another incarnation be implemented with two input elements, one a group of radio buttons and a dropdown, positioned in a vertical layout. Read the rest of this entry »

Building a repository of reusable ADF artefacts using ADF Libraries – for example: a reusable Placeholder Data Control

Reusability – and from there higher productivity and easier maintenance – is one of the key themes for ADF 11g. There are several important new concepts introduced in this new release, including Task Flows, Declarative Components, Page Templates and Page Fragments. It is of course one thing to create artefacts that are potentially reusable.  It is quite another to organize those artefacts and make them available across projects and applications. And that is where the ADF Library comes in. It is the vehicle for packaging up fairly small scoped reusable elements in JAR files that are then made available in the Resource Catalog.

It turns out to be incredibly easy to create an ADF Library – and to reuse one. I will demonstrate that in this article, by turning a Placeholder Data Control that provides off line data binding opportunities for applications using DEPT and EMP. I have created a Placeholder Data Control with Department and Employee Data Types and sample data taken from the SCOTT schema. (see Some more details on ADF Placeholder Data Control (rebind component, master detail, load sample data from CSV file)  for details on how to do that). Now I want to make that Placeholder Data Control available to any project I create where Dept/Emp data is useful and on line access to the database may not be available.

Note: it also makes sense for me to create an ADF Library with the HrmService ADF BC Application Module with the Entity and View Objects against the EMP and DEPT table that I so frequently use – and so frequently recreate because my personal reuse is organized so lamely! .... Read the rest of this entry »