SlideShare a Scribd company logo
Lecture 06
Process Design
Agenda
 Why Processes?
– Design Issues
– Architecture Issues
 RU Process Framework
Reading
 RuFramework source code
 XML
 Processing XML (video)
 Build Scripts (video)
 Java Technology and XML-Part One
– http://java.sun.com/developer/technicalArticles/xml/Ja
vaTechandXML/
Why Processes?
What is a Processes anyway?
 Enterprise system need to run processes for
several reasons
– Manual or automatic
 Things in the “background”
– Nightly update of customers
– Reconciliation of systems
 Lengthy operations
– Recalculate of all accounts
 Processes have no user interface
– Traditionally know as “Jobs”
Our Task
 We need to build a framework from running
processes.
 What patterns can we use?
Design Issues
 Each process has simple task
 Each process can be re-run at any time
 Locations are always the same
 Logging is always the same
 Customer specific functionality
can be added to generic processes
 Other considerations
– Must handle large amount of data
– Must support multiple threads for performance
Process Framework
Generic Process
Customer Specific Plugin
RU Process Framework
RU Framework
 Simple Framework developed during the course
– Illustrates design ideas
– Application Framework
– Reduce dependence on other frameworks by
wrapping them in interfaces and classes
– Builds on Spring
 Package
– is.ruframework
• domain
• process
– All classes are prefixed with “Ru”
Process Framework
 The idea is that the Process Framework starts
the process
 Process Developers must implement some
interface
 Information will be in a context XML file
Process Design
 Let’s create an interface, RuProcess
– This is what all processes have to implement
package is.ruframework.process;
public interface RuProcess
{
public void startProcess ();
public void beforeProcess ();
public void afterProcess ();
}
Process Design
 Let’s implement this with RuAbstractProcess
– Processes can extend this classes
package is.ruframework.process;
import is.ruframework.domain.RuObject;
abstract public class RuAbstractProcess extends
RuObject implements RuProcess
{
abstract public void startProcess ();
public void beforeProcess ()
{
}
public void afterProcess ()
{
}
}
Process Design
 We needs some context, RuProcessContext
– Processes can get information about their process
from this context
public class RuProcessContext
{
private String processName;
private String processClass;
private String importFile;
private String importURL;
private String dataSourceFile;
private Map params;
...
}
Process Design
 Let’s change the interface, RuProcess
– Dependency Injection
package is.ruframework.process;
public interface RuProcess
{
public void setProcessContext (RuProcessContext processContext);
public void setParameters(String[] params);
abstract public void startProcess ();
public void beforeProcess ();
public void afterProcess ();
}
Process Design
 Change the RuAbstractProcess
– Let this class implement the injection
abstract public class RuAbstractProcess extends RuObject
implements RuProcess
{
private RuProcessContext processContext;
private String contextFile;
private String parameters[];
...
public void setProcessContext(RuProcessContext
processContext)
{
this.processContext = processContext;
}
...
Process Design
 Let’s use a factory to create the process,
RuProcessFactory
– This class can load the context file
public class RuProcessFactory
{
private String contextFile;
private RuProcessContext processContext;
public RuProcess loadProcess(RuProcessContext ctx)
throws RuProcessException
public void loadProcessContext(String contextFile)
throws RuProcessException
...
}
Process Design
 Create a class to run the process
– This class puts everything together
public class RuProcessRunner extends RuObject
implements Runnable
{
private RuProcess process = null;
public static void main(String[] args)
{
}
public RuProcessRunner(String contextFile)
throws RuProcessException
public void run()
{
}
}
RU Process Framework
Implementation
Process Framework
 To create process, we must
– Create the process class that implements RuProcess
– Create the Process Context XML file
Process Context XML file
 The framework will create the object
RuProcessContext
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
http://www.springframework.org/dtd/spring-beans.dtd>
<beans>
<bean id="processContext” class="is.ruframework.process.RuProcessContext">
<property name="processName">
<value>RSSProcess</value>
</property>
<property name="importURL">
<value>http://rss.news.yahoo.com/rss/tech</value>
</property>
<property name="processClass">
<value>is.ru.honn.blog.process.RssReaderProcess</value>
</property>
</bean>
</beans>
RuProcessContext
 Class for storing the Process Context
– The environment the process runs in
– Attributes line process name, class, importURL, data
source
The RuProcess Interface
 RuProcess is the interface for all processes
 The framework will load the process context and
set with setProcessContext
– Dependency Injection
 The Framework will call the process methods
– beforeProcess, startProcess, afterProcess
RuProcess
 RuProcess is the interface for all processes
– The Process Factory will call setProcessContext
public interface RuProcess
{
public void setProcessContext(RuProcessContextprocessContext);
public void setParameters(String[] params);
public void startProcess ();
public void beforeProcess ();
public void afterProcess ();
}
RuAbstractProcess
 Abstract class that implements RuProcess
– Takes care of handling Process Context
– Overrides beforeProcess
and afterProcess with
empty methods,
allowing them to
become optional
– Declares
startProcess
as abstract
Layered Supertype
 Interface defines the methods needed
– Some are generic for all derived classes
 Use abstract super classes to implement some
but not all of the interface methods
RuAbstractProcess
abstract public class RuAbstractProcess extends RuObject
implements RuProcess {
private RuProcessContextprocessContext;
private String contextFile;
private String parameters[];
public void setProcessContext(RuProcessContextprocessContext)
{
this.processContext = processContext;
}
public RuProcessContextgetProcessContext()
{
return processContext;
}
...
abstract public void startProcess ();
public void beforeProcess () {}
public void afterProcess () {}
}
Eat these
RuProcessFactory
 Factory that loads processes
– Factroy and Plugin Patterns
– loadProcess method returns RuProcess
– Extends the generic RuFactory
RuProcessFactory
public class RuProcessFactory extends RuFactory {
private static final String PROCESS_CONTEXT = "process.xml";
private RuProcessContextprocessContext;
public RuProcessloadProcess(RuProcessContextctx)
throws RuProcessException {
RuProcess process = null;
// Load the process specified in the context file
try
{
Class cls = Class.forName(ctx.getProcessClass());
process = (RuProcess)cls.newInstance();
process.setProcessContext(ctx);
}
catch (Exception e)
{ ... }
return process;
}
RuProcessFactory
public void loadProcessContext(String contextFile)
throws RuProcessException
{
try
{
processContext = (RuProcessContext)getObject("processContext");
}
catch (BeansException e)
{
String tmp = "File '" + contextFile + "' not found. Exception: "
+ e.getMessage();
log.severe(tmp);
throw new RuProcessException(tmp, e);
}
}
RuProcessRunner
 Class that calls the factory and runs the process
– Name of Process Context file is parameter
RuProcessRunner
public static void main(String[] args)
{
RuProcessRunner runner;
if (args.length> 0) {
runner = new RuProcessRunner(args[0]);
}
else {
runner = new RuProcessRunner();
}
try {
runner.run();
}
catch (RuProcessExceptionfwpe) {
System.out.println(fwpe.getMessage());
}
}
RuProcessRunner
public RuProcessRunner(String contextFile) throws RuProcessException
{
if (contextFile == null) {
String tmp = "Parameter contextFile must not be null";
log.severe(tmp);
throw new RuProcessException(tmp);
}
RuProcessFactory factory = new RuProcessFactory(contextFile);
process = factory.loadProcess();
}
public void run()
{
if (process != null) {
process.beforeProcess();
process.startProcess();
process.afterProcess();
}
}
}
Process Framework
Process Framework
Data Transfer Object
Factory
Template Method
Plug-in
Layered Supertype
Dependency injection
Layered Supertype
Import Content Process
Import Content Process
 Problem
– We need to import RSS feeds into our database
– Example URL:
• http://rss.news.yahoo.com/rss/tech
 Solution
– Use the RU Framework
• ImportContentPrcess
– Use the FeedReader
Import Content Process
 Process that reads contents from an URL
 Tasks
– Creates a FeedReader to read entries
– The process implements the processContent callback
– Uses ContentService from our Domain Layer to store
each content
– Must log out the progress using a message source
Import Content Process
 Process that reads contents from an URL
 Tasks
– The Process must “wire” all components together
Import Content Process
 Process that reads contents from an URL
 Solution
– Create class ImportContentProcess that extends
RuAbstractProcess
• beforeProcess
• startProcess
• afterProcess
– Define the Process Context in process.xml
– Use Spring ApplicationContext to load all the
components
• Specified in app.xml
Import Content Process
public class ImportContentProcess extends RuAbstractProcess
implements FeedHandler
{
protected ContentServicecontentService;
FeedReader reader;
MessageSourcemsg;
public void beforeProcess()
{
ApplicationContextctx =
new FileSystemXmlApplicationContext("app.xml");
contentService = (ContentService)ctx.getBean("contentService");
reader = (FeedReader)ctx.getBean("feedReader");
reader.setFeedHandler(this);
msg = (MessageSource)ctx.getBean("messageSource");
log.info(msg.getMessage("processbefore",
new Object[] { getProcessContext().getProcessName() } ,
Locale.getDefault()));
}
Import Content Process
ApplicationContextctx =
new FileSystemXmlApplicationContext("app.xml");
contentService = (ContentService)ctx.getBean("contentService");
reader = (FeedReader)ctx.getBean("feedReader");
reader.setFeedHandler(this);
msg = (MessageSource)ctx.getBean("messageSource");
<beans>
<bean id="messageSource“ class=
"org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename“><value>messages</value></property>
</bean>
<bean id="contentService"
class="is.ru.honn.tube.service.content.ContentServiceStub">
</bean>
<bean id="feedReader"
class="is.ru.honn.tube.feeds.RssReader">
</bean>
</beans>
app.xml
Import Content Process
public void startProcess()
{
log.info(msg.getMessage("processstart",
new Object[] { getProcessContext().getProcessName() },
Locale.getDefault()));
try
{
reader.read(getProcessContext().getImportURL());
}
catch (FeedException e)
{
log.info(msg.getMessage("processreaderror",
new Object[] { getProcessContext().getImportFile() },
Locale.getDefault()));
log.info(e.getMessage());
}
log.info(msg.getMessage("processstartdone",
new Object[] {contentService.getContents().size()},
Locale.getDefault()));
}
Collecting the Entries
public void processContent(Object content)
{
contentService.addContent((Content)content);
}
Running the Process
public void afterProcess()
{
Collection<Content>col = contentService.getContents();
for (Content cnt: col)
{
System.out.println(cnt);
}
}
Message Source
log.info(msg.getMessage("processstart",
new Object[] { getProcessContext().getProcessName() },
Locale.getDefault()));
processbefore=The process {0} is starting (beforeProcess).
processstart=Starting process {0}
processstartdone=Reading done. Read {0} contents
processreaderror=Unable to read file ''{0}''.
messages.properties
msg = (MessageSource)ctx.getBean("messageSource");
<bean id="messageSource“ class=
"org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename“><value>messages</value></property>
</bean>
app.xml
startProcess in ImportContentProcess.java
beforeProcess in ImportContentProcess.java
Using the ContentService
public void processContent(Content content)
{
contentService.addContent(content);
}
public interface ContentService
{
public void addContent(Content content);
public Collection<Content>getContents();
}
while (i.hasNext())
{
ent = (SyndEntry)i.next();
content = new Content();
content.setTitle(ent.getTitle());
...
handler.processContent(content);
}
read in RssReader.java
ImportContentProcess.java
ContentService.java
Printing out values
public void afterProcess()
{
Collection<Content>col = contentService.getContents();
for (Content cnt: col)
{
System.out.println(cnt);
}
}INFO: The process ImportContentProcess is starting (beforeProcess).
Sep 28, 2008 3:09:31 PM is.ru.honn.tube.process.ImportContentProcessstar
INFO: Starting process ImportContentProcess
Sep 28, 2008 3:09:32 PM is.ru.honn.tube.process.ImportContentProcessstar
INFO: Reading done. Read 12 contents
Japan's online social scene isn't so social
(AP)
Unlocked iPhone 3G on sale in Hong Kong
Run with IntelliJ
Running the Process
INFO: Starting process ImportContentProcess
Sep 24, 2012 8:43:50 AM is.ru.honn.tube.process.ImportContentProcess
startProcess
INFO: Reading done. Read 40 contents
Many US stores report being sold out of iPhone 5s
Apple supplier halts China factory after violence
Apple, Samsung demand changes to $1B verdict
This is Scary: Scientists find a way to erase frightening memories
Verizon’s iPhone 5 being sold unlocked, allowing it to be used
internationally
Why Burberry Wants to Bring the Online Experience to Stores, and Not Vice
Versa
Apple, Samsung demand changes to $1B verdict
iPhone 5 launch draws Apple fans worldwide
Verizon iPhone 5's secret feature: It's 'unlocked'
Review: iPhone evolves into jewel-like '5'
Processing XML
Overview
XML Example
<?xml version="1.0" encoding=”UTF-8"?>
<teams>
<team>
<id>ENG001</id>
<name>Arsenal</name>
<league>ENG001</league>
<sport>FOOTBALL</sport>
<country>England</country>
</team>
...
</teams>
XML RSS Example
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
<channel>
<title>YouTube :: Recently Added Videos</title>
<link>http://youtube.com/rss/global/recently_added.rss</link>
<description>Recently Added Videos</description>
<item>
<author>rss@youtube.com (lokipsa)</author>
<title>Profile pic test</title>
<link>http://youtube.com/?v=1mpDAAMwoQo</link>
<description>
<![CDATA[
<img src="http://sjl-static2.sjl.youtube.com/vi/1mpDAAMwoQo/2.jpg"
align="right" ...
</p>
]]>
</description>
Valid and well-formed docments
 XML document is well-formed if it is according to
the XML standard
– Correct according to the rules
 XML document is valid if it is according to some
specific Document Definition (DTD) or Schema
– Correct according to DTD or Schema
 XML document that is not well-formed is not
usable
– Unlike HTML
XML Properties
 XML documents are tree
 Each node is also a tree or a leaf
 Benfits
– Easy to traverse the document
– Easy to build new documents
– Allows for XSLT transformation
– Easy to work with parts of the
document
 XML parser can use these properties
Parsing
 To use XML document it must be parsed
 XML Parser
– Reads in the XML document
– Provides data to tree form to work with
 Two basic methods
– DOM – Document Object Model
– SAX – Simple API of XML
 JDom is a library that simplifies both
The DOM Concept
 Tree is built – DOM
The SAX Concept
 SAX will send a message
– Calls methods in Handler
JDom
 DOM and SAX are low-level APIs
– Cumbersome to use
 JDom is a simple class library for XML parsing
– Supports both DOM and SAX
– Goal is to simplify using XML
 Packages
– org.jdom
XML
 XML is universal, simple to understand
 Good when exchanging data
 There is time and space complexity
Summary
 Process Framework
 Import Content Process
 XML

More Related Content

What's hot

Poster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsPoster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default Methods
Raffi Khatchadourian
 
java-06inheritance
java-06inheritancejava-06inheritance
java-06inheritance
Arjun Shanka
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
Pushpa Yakkala
 
Php unit (eng)
Php unit (eng)Php unit (eng)
Php unit (eng)
Anatoliy Okhotnikov
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
Kavitha713564
 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Ivo Neskovic
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
Raja Sekhar
 
Cpp unit
Cpp unit Cpp unit
Cpp unit
mudabbirwarsi
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverage
Nirav Desai
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Anand Kumar Rajana
 
Junit4.0
Junit4.0Junit4.0
Junit4.0
gouthamrv
 
Pptchapter04
Pptchapter04Pptchapter04
Pptchapter04
Richard Styner
 
6.Spring DI_1
6.Spring DI_16.Spring DI_1
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
Subash John
 
Model-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product LinesModel-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product Lines
Markus Voelter
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
umardanjumamaiwada
 
Template Method Pattern
Template Method PatternTemplate Method Pattern
Template Method Pattern
monisiqbal
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black Hole
Noam Kfir
 
Template method pattern example
Template method pattern exampleTemplate method pattern example
Template method pattern example
Guo Albert
 
Ppt chapter07
Ppt chapter07Ppt chapter07
Ppt chapter07
Richard Styner
 

What's hot (20)

Poster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default MethodsPoster on Automated Refactoring of Legacy Java Software to Default Methods
Poster on Automated Refactoring of Legacy Java Software to Default Methods
 
java-06inheritance
java-06inheritancejava-06inheritance
java-06inheritance
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
 
Php unit (eng)
Php unit (eng)Php unit (eng)
Php unit (eng)
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
 
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal ApproachProject FoX: A Tool That Offers Automated Testing Using a Formal Approach
Project FoX: A Tool That Offers Automated Testing Using a Formal Approach
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Cpp unit
Cpp unit Cpp unit
Cpp unit
 
Session 7 code_functional_coverage
Session 7 code_functional_coverageSession 7 code_functional_coverage
Session 7 code_functional_coverage
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Junit4.0
Junit4.0Junit4.0
Junit4.0
 
Pptchapter04
Pptchapter04Pptchapter04
Pptchapter04
 
6.Spring DI_1
6.Spring DI_16.Spring DI_1
6.Spring DI_1
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
 
Model-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product LinesModel-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product Lines
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Template Method Pattern
Template Method PatternTemplate Method Pattern
Template Method Pattern
 
TDD and the Legacy Code Black Hole
TDD and the Legacy Code Black HoleTDD and the Legacy Code Black Hole
TDD and the Legacy Code Black Hole
 
Template method pattern example
Template method pattern exampleTemplate method pattern example
Template method pattern example
 
Ppt chapter07
Ppt chapter07Ppt chapter07
Ppt chapter07
 

Viewers also liked

New Technology 2015 L02 A Journey Exploring Technology
New Technology 2015 L02 A Journey Exploring TechnologyNew Technology 2015 L02 A Journey Exploring Technology
New Technology 2015 L02 A Journey Exploring Technology
Ólafur Andri Ragnarsson
 
L07 Becoming Invisible
L07 Becoming InvisibleL07 Becoming Invisible
L07 Becoming Invisible
Ólafur Andri Ragnarsson
 
L04 base patterns
L04 base patternsL04 base patterns
L04 base patterns
Ólafur Andri Ragnarsson
 
Responsible gaming in the Online Internet World
Responsible gaming in the Online Internet WorldResponsible gaming in the Online Internet World
Responsible gaming in the Online Internet World
Ólafur Andri Ragnarsson
 
New gambling options with digital gaming platforms
New gambling options with digital gaming platforms New gambling options with digital gaming platforms
New gambling options with digital gaming platforms
Ólafur Andri Ragnarsson
 
L03 Design Patterns
L03 Design PatternsL03 Design Patterns
L03 Design Patterns
Ólafur Andri Ragnarsson
 
L02 Software Design
L02 Software DesignL02 Software Design
L02 Software Design
Ólafur Andri Ragnarsson
 
New Technology Lecture L16 A Worldwide Network
New Technology Lecture L16 A Worldwide NetworkNew Technology Lecture L16 A Worldwide Network
New Technology Lecture L16 A Worldwide Network
Ólafur Andri Ragnarsson
 
L05 Innovation
L05 InnovationL05 Innovation
L05 Innovation
Ólafur Andri Ragnarsson
 
L06 Diffusion of Innovation
L06 Diffusion of InnovationL06 Diffusion of Innovation
L06 Diffusion of Innovation
Ólafur Andri Ragnarsson
 
L04 Adjacent Possible
L04 Adjacent PossibleL04 Adjacent Possible
L04 Adjacent Possible
Ólafur Andri Ragnarsson
 
New Technology 2015 L03 Exponential World
New Technology 2015 L03 Exponential WorldNew Technology 2015 L03 Exponential World
New Technology 2015 L03 Exponential World
Ólafur Andri Ragnarsson
 
New Technology 2016 L01 Introduction
New Technology 2016 L01 IntroductionNew Technology 2016 L01 Introduction
New Technology 2016 L01 Introduction
Ólafur Andri Ragnarsson
 
L01 Enterprise Application Architecture
L01 Enterprise Application ArchitectureL01 Enterprise Application Architecture
L01 Enterprise Application Architecture
Ólafur Andri Ragnarsson
 

Viewers also liked (14)

New Technology 2015 L02 A Journey Exploring Technology
New Technology 2015 L02 A Journey Exploring TechnologyNew Technology 2015 L02 A Journey Exploring Technology
New Technology 2015 L02 A Journey Exploring Technology
 
L07 Becoming Invisible
L07 Becoming InvisibleL07 Becoming Invisible
L07 Becoming Invisible
 
L04 base patterns
L04 base patternsL04 base patterns
L04 base patterns
 
Responsible gaming in the Online Internet World
Responsible gaming in the Online Internet WorldResponsible gaming in the Online Internet World
Responsible gaming in the Online Internet World
 
New gambling options with digital gaming platforms
New gambling options with digital gaming platforms New gambling options with digital gaming platforms
New gambling options with digital gaming platforms
 
L03 Design Patterns
L03 Design PatternsL03 Design Patterns
L03 Design Patterns
 
L02 Software Design
L02 Software DesignL02 Software Design
L02 Software Design
 
New Technology Lecture L16 A Worldwide Network
New Technology Lecture L16 A Worldwide NetworkNew Technology Lecture L16 A Worldwide Network
New Technology Lecture L16 A Worldwide Network
 
L05 Innovation
L05 InnovationL05 Innovation
L05 Innovation
 
L06 Diffusion of Innovation
L06 Diffusion of InnovationL06 Diffusion of Innovation
L06 Diffusion of Innovation
 
L04 Adjacent Possible
L04 Adjacent PossibleL04 Adjacent Possible
L04 Adjacent Possible
 
New Technology 2015 L03 Exponential World
New Technology 2015 L03 Exponential WorldNew Technology 2015 L03 Exponential World
New Technology 2015 L03 Exponential World
 
New Technology 2016 L01 Introduction
New Technology 2016 L01 IntroductionNew Technology 2016 L01 Introduction
New Technology 2016 L01 Introduction
 
L01 Enterprise Application Architecture
L01 Enterprise Application ArchitectureL01 Enterprise Application Architecture
L01 Enterprise Application Architecture
 

Similar to L06 process design

L11 Process Design
L11 Process DesignL11 Process Design
L11 Process Design
Ólafur Andri Ragnarsson
 
L09 Process Design
L09 Process DesignL09 Process Design
L09 Process Design
Ólafur Andri Ragnarsson
 
Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow engine
dmoebius
 
Express: A Jump-Start
Express: A Jump-StartExpress: A Jump-Start
Express: A Jump-Start
Naveen Pete
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
Syed Asrarali
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
Syed Asrarali
 
Nov. 4, 2011 o reilly webcast-hbase- lars george
Nov. 4, 2011 o reilly webcast-hbase- lars georgeNov. 4, 2011 o reilly webcast-hbase- lars george
Nov. 4, 2011 o reilly webcast-hbase- lars george
O'Reilly Media
 
18 concurrency
18   concurrency18   concurrency
18 concurrency
dhrubo kayal
 
Introducing Node.js in an Oracle technology environment (including hands-on)
Introducing Node.js in an Oracle technology environment (including hands-on)Introducing Node.js in an Oracle technology environment (including hands-on)
Introducing Node.js in an Oracle technology environment (including hands-on)
Lucas Jellema
 
Building resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with SpringBuilding resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with Spring
Marek Jeszka
 
Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02
Sven Ruppert
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
Codemotion
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
Ben Lin
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
Ahmed Assaf
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
jain.pralabh
 
Annotation processing
Annotation processingAnnotation processing
Annotation processing
Florent Champigny
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
Marcelo Ochoa
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaert
mfrancis
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
Ortus Solutions, Corp
 

Similar to L06 process design (20)

L11 Process Design
L11 Process DesignL11 Process Design
L11 Process Design
 
L09 Process Design
L09 Process DesignL09 Process Design
L09 Process Design
 
Copper: A high performance workflow engine
Copper: A high performance workflow engineCopper: A high performance workflow engine
Copper: A high performance workflow engine
 
Express: A Jump-Start
Express: A Jump-StartExpress: A Jump-Start
Express: A Jump-Start
 
Intro to tsql
Intro to tsqlIntro to tsql
Intro to tsql
 
Intro to tsql unit 14
Intro to tsql   unit 14Intro to tsql   unit 14
Intro to tsql unit 14
 
Nov. 4, 2011 o reilly webcast-hbase- lars george
Nov. 4, 2011 o reilly webcast-hbase- lars georgeNov. 4, 2011 o reilly webcast-hbase- lars george
Nov. 4, 2011 o reilly webcast-hbase- lars george
 
18 concurrency
18   concurrency18   concurrency
18 concurrency
 
Introducing Node.js in an Oracle technology environment (including hands-on)
Introducing Node.js in an Oracle technology environment (including hands-on)Introducing Node.js in an Oracle technology environment (including hands-on)
Introducing Node.js in an Oracle technology environment (including hands-on)
 
Building resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with SpringBuilding resilient scheduling in distributed systems with Spring
Building resilient scheduling in distributed systems with Spring
 
Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
 
Annotation processing
Annotation processingAnnotation processing
Annotation processing
 
Native REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11gNative REST Web Services with Oracle 11g
Native REST Web Services with Oracle 11g
 
OSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David BosschaertOSGi Cloud Ecosystems - David Bosschaert
OSGi Cloud Ecosystems - David Bosschaert
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 

More from Ólafur Andri Ragnarsson

Nýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfaraNýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfara
Ólafur Andri Ragnarsson
 
Nýjast tækni og framtíðin
Nýjast tækni og framtíðinNýjast tækni og framtíðin
Nýjast tækni og framtíðin
Ólafur Andri Ragnarsson
 
New Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course IntroductionNew Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course Introduction
Ólafur Andri Ragnarsson
 
L01 Introduction
L01 IntroductionL01 Introduction
L01 Introduction
Ólafur Andri Ragnarsson
 
L23 Robotics and Drones
L23 Robotics and Drones L23 Robotics and Drones
L23 Robotics and Drones
Ólafur Andri Ragnarsson
 
L22 Augmented and Virtual Reality
L22 Augmented and Virtual RealityL22 Augmented and Virtual Reality
L22 Augmented and Virtual Reality
Ólafur Andri Ragnarsson
 
L20 Personalised World
L20 Personalised WorldL20 Personalised World
L20 Personalised World
Ólafur Andri Ragnarsson
 
L19 Network Platforms
L19 Network PlatformsL19 Network Platforms
L19 Network Platforms
Ólafur Andri Ragnarsson
 
L18 Big Data and Analytics
L18 Big Data and AnalyticsL18 Big Data and Analytics
L18 Big Data and Analytics
Ólafur Andri Ragnarsson
 
L17 Algorithms and AI
L17 Algorithms and AIL17 Algorithms and AI
L17 Algorithms and AI
Ólafur Andri Ragnarsson
 
L16 Internet of Things
L16 Internet of ThingsL16 Internet of Things
L16 Internet of Things
Ólafur Andri Ragnarsson
 
L14 From the Internet to Blockchain
L14 From the Internet to BlockchainL14 From the Internet to Blockchain
L14 From the Internet to Blockchain
Ólafur Andri Ragnarsson
 
L14 The Mobile Revolution
L14 The Mobile RevolutionL14 The Mobile Revolution
L14 The Mobile Revolution
Ólafur Andri Ragnarsson
 
New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine
Ólafur Andri Ragnarsson
 
L12 digital transformation
L12 digital transformationL12 digital transformation
L12 digital transformation
Ólafur Andri Ragnarsson
 
L10 The Innovator's Dilemma
L10 The Innovator's DilemmaL10 The Innovator's Dilemma
L10 The Innovator's Dilemma
Ólafur Andri Ragnarsson
 
L09 Disruptive Technology
L09 Disruptive TechnologyL09 Disruptive Technology
L09 Disruptive Technology
Ólafur Andri Ragnarsson
 
L09 Technological Revolutions
L09 Technological RevolutionsL09 Technological Revolutions
L09 Technological Revolutions
Ólafur Andri Ragnarsson
 
L07 Becoming Invisible
L07 Becoming InvisibleL07 Becoming Invisible
L07 Becoming Invisible
Ólafur Andri Ragnarsson
 
L06 Diffusion of Innovation
L06 Diffusion of InnovationL06 Diffusion of Innovation
L06 Diffusion of Innovation
Ólafur Andri Ragnarsson
 

More from Ólafur Andri Ragnarsson (20)

Nýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfaraNýsköpun - Leiðin til framfara
Nýsköpun - Leiðin til framfara
 
Nýjast tækni og framtíðin
Nýjast tækni og framtíðinNýjast tækni og framtíðin
Nýjast tækni og framtíðin
 
New Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course IntroductionNew Technology Summer 2020 Course Introduction
New Technology Summer 2020 Course Introduction
 
L01 Introduction
L01 IntroductionL01 Introduction
L01 Introduction
 
L23 Robotics and Drones
L23 Robotics and Drones L23 Robotics and Drones
L23 Robotics and Drones
 
L22 Augmented and Virtual Reality
L22 Augmented and Virtual RealityL22 Augmented and Virtual Reality
L22 Augmented and Virtual Reality
 
L20 Personalised World
L20 Personalised WorldL20 Personalised World
L20 Personalised World
 
L19 Network Platforms
L19 Network PlatformsL19 Network Platforms
L19 Network Platforms
 
L18 Big Data and Analytics
L18 Big Data and AnalyticsL18 Big Data and Analytics
L18 Big Data and Analytics
 
L17 Algorithms and AI
L17 Algorithms and AIL17 Algorithms and AI
L17 Algorithms and AI
 
L16 Internet of Things
L16 Internet of ThingsL16 Internet of Things
L16 Internet of Things
 
L14 From the Internet to Blockchain
L14 From the Internet to BlockchainL14 From the Internet to Blockchain
L14 From the Internet to Blockchain
 
L14 The Mobile Revolution
L14 The Mobile RevolutionL14 The Mobile Revolution
L14 The Mobile Revolution
 
New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine New Technology 2019 L13 Rise of the Machine
New Technology 2019 L13 Rise of the Machine
 
L12 digital transformation
L12 digital transformationL12 digital transformation
L12 digital transformation
 
L10 The Innovator's Dilemma
L10 The Innovator's DilemmaL10 The Innovator's Dilemma
L10 The Innovator's Dilemma
 
L09 Disruptive Technology
L09 Disruptive TechnologyL09 Disruptive Technology
L09 Disruptive Technology
 
L09 Technological Revolutions
L09 Technological RevolutionsL09 Technological Revolutions
L09 Technological Revolutions
 
L07 Becoming Invisible
L07 Becoming InvisibleL07 Becoming Invisible
L07 Becoming Invisible
 
L06 Diffusion of Innovation
L06 Diffusion of InnovationL06 Diffusion of Innovation
L06 Diffusion of Innovation
 

Recently uploaded

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Zilliz
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...Building RAG with self-deployed Milvus vector database and Snowpark Container...
Building RAG with self-deployed Milvus vector database and Snowpark Container...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

L06 process design

  • 2. Agenda  Why Processes? – Design Issues – Architecture Issues  RU Process Framework
  • 3. Reading  RuFramework source code  XML  Processing XML (video)  Build Scripts (video)  Java Technology and XML-Part One – http://java.sun.com/developer/technicalArticles/xml/Ja vaTechandXML/
  • 5. What is a Processes anyway?  Enterprise system need to run processes for several reasons – Manual or automatic  Things in the “background” – Nightly update of customers – Reconciliation of systems  Lengthy operations – Recalculate of all accounts  Processes have no user interface – Traditionally know as “Jobs”
  • 6. Our Task  We need to build a framework from running processes.  What patterns can we use?
  • 7. Design Issues  Each process has simple task  Each process can be re-run at any time  Locations are always the same  Logging is always the same  Customer specific functionality can be added to generic processes  Other considerations – Must handle large amount of data – Must support multiple threads for performance Process Framework Generic Process Customer Specific Plugin
  • 9. RU Framework  Simple Framework developed during the course – Illustrates design ideas – Application Framework – Reduce dependence on other frameworks by wrapping them in interfaces and classes – Builds on Spring  Package – is.ruframework • domain • process – All classes are prefixed with “Ru”
  • 10. Process Framework  The idea is that the Process Framework starts the process  Process Developers must implement some interface  Information will be in a context XML file
  • 11. Process Design  Let’s create an interface, RuProcess – This is what all processes have to implement package is.ruframework.process; public interface RuProcess { public void startProcess (); public void beforeProcess (); public void afterProcess (); }
  • 12. Process Design  Let’s implement this with RuAbstractProcess – Processes can extend this classes package is.ruframework.process; import is.ruframework.domain.RuObject; abstract public class RuAbstractProcess extends RuObject implements RuProcess { abstract public void startProcess (); public void beforeProcess () { } public void afterProcess () { } }
  • 13. Process Design  We needs some context, RuProcessContext – Processes can get information about their process from this context public class RuProcessContext { private String processName; private String processClass; private String importFile; private String importURL; private String dataSourceFile; private Map params; ... }
  • 14. Process Design  Let’s change the interface, RuProcess – Dependency Injection package is.ruframework.process; public interface RuProcess { public void setProcessContext (RuProcessContext processContext); public void setParameters(String[] params); abstract public void startProcess (); public void beforeProcess (); public void afterProcess (); }
  • 15. Process Design  Change the RuAbstractProcess – Let this class implement the injection abstract public class RuAbstractProcess extends RuObject implements RuProcess { private RuProcessContext processContext; private String contextFile; private String parameters[]; ... public void setProcessContext(RuProcessContext processContext) { this.processContext = processContext; } ...
  • 16. Process Design  Let’s use a factory to create the process, RuProcessFactory – This class can load the context file public class RuProcessFactory { private String contextFile; private RuProcessContext processContext; public RuProcess loadProcess(RuProcessContext ctx) throws RuProcessException public void loadProcessContext(String contextFile) throws RuProcessException ... }
  • 17. Process Design  Create a class to run the process – This class puts everything together public class RuProcessRunner extends RuObject implements Runnable { private RuProcess process = null; public static void main(String[] args) { } public RuProcessRunner(String contextFile) throws RuProcessException public void run() { } }
  • 19. Process Framework  To create process, we must – Create the process class that implements RuProcess – Create the Process Context XML file
  • 20. Process Context XML file  The framework will create the object RuProcessContext <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" http://www.springframework.org/dtd/spring-beans.dtd> <beans> <bean id="processContext” class="is.ruframework.process.RuProcessContext"> <property name="processName"> <value>RSSProcess</value> </property> <property name="importURL"> <value>http://rss.news.yahoo.com/rss/tech</value> </property> <property name="processClass"> <value>is.ru.honn.blog.process.RssReaderProcess</value> </property> </bean> </beans>
  • 21. RuProcessContext  Class for storing the Process Context – The environment the process runs in – Attributes line process name, class, importURL, data source
  • 22. The RuProcess Interface  RuProcess is the interface for all processes  The framework will load the process context and set with setProcessContext – Dependency Injection  The Framework will call the process methods – beforeProcess, startProcess, afterProcess
  • 23. RuProcess  RuProcess is the interface for all processes – The Process Factory will call setProcessContext public interface RuProcess { public void setProcessContext(RuProcessContextprocessContext); public void setParameters(String[] params); public void startProcess (); public void beforeProcess (); public void afterProcess (); }
  • 24. RuAbstractProcess  Abstract class that implements RuProcess – Takes care of handling Process Context – Overrides beforeProcess and afterProcess with empty methods, allowing them to become optional – Declares startProcess as abstract
  • 25. Layered Supertype  Interface defines the methods needed – Some are generic for all derived classes  Use abstract super classes to implement some but not all of the interface methods
  • 26. RuAbstractProcess abstract public class RuAbstractProcess extends RuObject implements RuProcess { private RuProcessContextprocessContext; private String contextFile; private String parameters[]; public void setProcessContext(RuProcessContextprocessContext) { this.processContext = processContext; } public RuProcessContextgetProcessContext() { return processContext; } ... abstract public void startProcess (); public void beforeProcess () {} public void afterProcess () {} } Eat these
  • 27. RuProcessFactory  Factory that loads processes – Factroy and Plugin Patterns – loadProcess method returns RuProcess – Extends the generic RuFactory
  • 28. RuProcessFactory public class RuProcessFactory extends RuFactory { private static final String PROCESS_CONTEXT = "process.xml"; private RuProcessContextprocessContext; public RuProcessloadProcess(RuProcessContextctx) throws RuProcessException { RuProcess process = null; // Load the process specified in the context file try { Class cls = Class.forName(ctx.getProcessClass()); process = (RuProcess)cls.newInstance(); process.setProcessContext(ctx); } catch (Exception e) { ... } return process; }
  • 29. RuProcessFactory public void loadProcessContext(String contextFile) throws RuProcessException { try { processContext = (RuProcessContext)getObject("processContext"); } catch (BeansException e) { String tmp = "File '" + contextFile + "' not found. Exception: " + e.getMessage(); log.severe(tmp); throw new RuProcessException(tmp, e); } }
  • 30. RuProcessRunner  Class that calls the factory and runs the process – Name of Process Context file is parameter
  • 31. RuProcessRunner public static void main(String[] args) { RuProcessRunner runner; if (args.length> 0) { runner = new RuProcessRunner(args[0]); } else { runner = new RuProcessRunner(); } try { runner.run(); } catch (RuProcessExceptionfwpe) { System.out.println(fwpe.getMessage()); } }
  • 32. RuProcessRunner public RuProcessRunner(String contextFile) throws RuProcessException { if (contextFile == null) { String tmp = "Parameter contextFile must not be null"; log.severe(tmp); throw new RuProcessException(tmp); } RuProcessFactory factory = new RuProcessFactory(contextFile); process = factory.loadProcess(); } public void run() { if (process != null) { process.beforeProcess(); process.startProcess(); process.afterProcess(); } } }
  • 34. Process Framework Data Transfer Object Factory Template Method Plug-in Layered Supertype Dependency injection Layered Supertype
  • 36. Import Content Process  Problem – We need to import RSS feeds into our database – Example URL: • http://rss.news.yahoo.com/rss/tech  Solution – Use the RU Framework • ImportContentPrcess – Use the FeedReader
  • 37. Import Content Process  Process that reads contents from an URL  Tasks – Creates a FeedReader to read entries – The process implements the processContent callback – Uses ContentService from our Domain Layer to store each content – Must log out the progress using a message source
  • 38. Import Content Process  Process that reads contents from an URL  Tasks – The Process must “wire” all components together
  • 39. Import Content Process  Process that reads contents from an URL  Solution – Create class ImportContentProcess that extends RuAbstractProcess • beforeProcess • startProcess • afterProcess – Define the Process Context in process.xml – Use Spring ApplicationContext to load all the components • Specified in app.xml
  • 40. Import Content Process public class ImportContentProcess extends RuAbstractProcess implements FeedHandler { protected ContentServicecontentService; FeedReader reader; MessageSourcemsg; public void beforeProcess() { ApplicationContextctx = new FileSystemXmlApplicationContext("app.xml"); contentService = (ContentService)ctx.getBean("contentService"); reader = (FeedReader)ctx.getBean("feedReader"); reader.setFeedHandler(this); msg = (MessageSource)ctx.getBean("messageSource"); log.info(msg.getMessage("processbefore", new Object[] { getProcessContext().getProcessName() } , Locale.getDefault())); }
  • 41. Import Content Process ApplicationContextctx = new FileSystemXmlApplicationContext("app.xml"); contentService = (ContentService)ctx.getBean("contentService"); reader = (FeedReader)ctx.getBean("feedReader"); reader.setFeedHandler(this); msg = (MessageSource)ctx.getBean("messageSource"); <beans> <bean id="messageSource“ class= "org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename“><value>messages</value></property> </bean> <bean id="contentService" class="is.ru.honn.tube.service.content.ContentServiceStub"> </bean> <bean id="feedReader" class="is.ru.honn.tube.feeds.RssReader"> </bean> </beans> app.xml
  • 42. Import Content Process public void startProcess() { log.info(msg.getMessage("processstart", new Object[] { getProcessContext().getProcessName() }, Locale.getDefault())); try { reader.read(getProcessContext().getImportURL()); } catch (FeedException e) { log.info(msg.getMessage("processreaderror", new Object[] { getProcessContext().getImportFile() }, Locale.getDefault())); log.info(e.getMessage()); } log.info(msg.getMessage("processstartdone", new Object[] {contentService.getContents().size()}, Locale.getDefault())); }
  • 43. Collecting the Entries public void processContent(Object content) { contentService.addContent((Content)content); }
  • 44. Running the Process public void afterProcess() { Collection<Content>col = contentService.getContents(); for (Content cnt: col) { System.out.println(cnt); } }
  • 45. Message Source log.info(msg.getMessage("processstart", new Object[] { getProcessContext().getProcessName() }, Locale.getDefault())); processbefore=The process {0} is starting (beforeProcess). processstart=Starting process {0} processstartdone=Reading done. Read {0} contents processreaderror=Unable to read file ''{0}''. messages.properties msg = (MessageSource)ctx.getBean("messageSource"); <bean id="messageSource“ class= "org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename“><value>messages</value></property> </bean> app.xml startProcess in ImportContentProcess.java beforeProcess in ImportContentProcess.java
  • 46. Using the ContentService public void processContent(Content content) { contentService.addContent(content); } public interface ContentService { public void addContent(Content content); public Collection<Content>getContents(); } while (i.hasNext()) { ent = (SyndEntry)i.next(); content = new Content(); content.setTitle(ent.getTitle()); ... handler.processContent(content); } read in RssReader.java ImportContentProcess.java ContentService.java
  • 47. Printing out values public void afterProcess() { Collection<Content>col = contentService.getContents(); for (Content cnt: col) { System.out.println(cnt); } }INFO: The process ImportContentProcess is starting (beforeProcess). Sep 28, 2008 3:09:31 PM is.ru.honn.tube.process.ImportContentProcessstar INFO: Starting process ImportContentProcess Sep 28, 2008 3:09:32 PM is.ru.honn.tube.process.ImportContentProcessstar INFO: Reading done. Read 12 contents Japan's online social scene isn't so social (AP) Unlocked iPhone 3G on sale in Hong Kong
  • 49. Running the Process INFO: Starting process ImportContentProcess Sep 24, 2012 8:43:50 AM is.ru.honn.tube.process.ImportContentProcess startProcess INFO: Reading done. Read 40 contents Many US stores report being sold out of iPhone 5s Apple supplier halts China factory after violence Apple, Samsung demand changes to $1B verdict This is Scary: Scientists find a way to erase frightening memories Verizon’s iPhone 5 being sold unlocked, allowing it to be used internationally Why Burberry Wants to Bring the Online Experience to Stores, and Not Vice Versa Apple, Samsung demand changes to $1B verdict iPhone 5 launch draws Apple fans worldwide Verizon iPhone 5's secret feature: It's 'unlocked' Review: iPhone evolves into jewel-like '5'
  • 52. XML Example <?xml version="1.0" encoding=”UTF-8"?> <teams> <team> <id>ENG001</id> <name>Arsenal</name> <league>ENG001</league> <sport>FOOTBALL</sport> <country>England</country> </team> ... </teams>
  • 53. XML RSS Example <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss"> <channel> <title>YouTube :: Recently Added Videos</title> <link>http://youtube.com/rss/global/recently_added.rss</link> <description>Recently Added Videos</description> <item> <author>rss@youtube.com (lokipsa)</author> <title>Profile pic test</title> <link>http://youtube.com/?v=1mpDAAMwoQo</link> <description> <![CDATA[ <img src="http://sjl-static2.sjl.youtube.com/vi/1mpDAAMwoQo/2.jpg" align="right" ... </p> ]]> </description>
  • 54. Valid and well-formed docments  XML document is well-formed if it is according to the XML standard – Correct according to the rules  XML document is valid if it is according to some specific Document Definition (DTD) or Schema – Correct according to DTD or Schema  XML document that is not well-formed is not usable – Unlike HTML
  • 55. XML Properties  XML documents are tree  Each node is also a tree or a leaf  Benfits – Easy to traverse the document – Easy to build new documents – Allows for XSLT transformation – Easy to work with parts of the document  XML parser can use these properties
  • 56. Parsing  To use XML document it must be parsed  XML Parser – Reads in the XML document – Provides data to tree form to work with  Two basic methods – DOM – Document Object Model – SAX – Simple API of XML  JDom is a library that simplifies both
  • 57. The DOM Concept  Tree is built – DOM
  • 58. The SAX Concept  SAX will send a message – Calls methods in Handler
  • 59. JDom  DOM and SAX are low-level APIs – Cumbersome to use  JDom is a simple class library for XML parsing – Supports both DOM and SAX – Goal is to simplify using XML  Packages – org.jdom
  • 60. XML  XML is universal, simple to understand  Good when exchanging data  There is time and space complexity
  • 61. Summary  Process Framework  Import Content Process  XML