oracle adf architecture tv - design - adf bc application module design

Download Oracle ADF Architecture TV - Design - ADF BC Application Module Design

Post on 10-Nov-2014

282 views

Category:

Technology

2 download

Embed Size (px)

DESCRIPTION

Slides from Oracle's ADF Architecture TV series covering the Design phase of ADF projects, considering ADF Business Components application module design. Like to know more? Check out: - Subscribe to the YouTube channel - http://bit.ly/adftvsub - Design Playlist - http://www.youtube.com/playlist?list=PLJz3HAsCPVaSemIjFk4lfokNynzp5Euet - Read the episode index on the ADF Architecture Square - http://bit.ly/adfarchsquare

TRANSCRIPT

  • 1. 1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.
  • 2. 2 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Real World ADF Design & Architecture Principles ADF BC Application Module Design 15th Feb 2013 v1.0
  • 3. 3 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Learning Objectives At the end of this module you should be able to: Determine if you need to create multiple root Application Modules or can survive with one Understand when your architecture will mean you have multiple Application Modules regardless and how you avoid consuming too many database connections Technique to future proof your application module design When and why you should use shared application modules Image: imagerymajestic/ FreeDigitalPhotos.net
  • 4. 4 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda Root and Nested Application Modules Number of Root Application Modules Application Module Connection Sharing Future Proofing Application Module Design Shared Application Modules
  • 5. 5 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Root Application Modules Expose View Objects to the Binding layer and indirectly the View layer as the basis of what is displayed to the user 1 instance given to each user at runtime, unless shared Stateful Design time configure one JDBC URL/JNDI DataSource Connect to the database, by inference control database transactions Each root AM has its own application module pool Image: winnond/ FreeDigitalPhotos.net
  • 6. 6 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Root vs Nested Application Modules An application can have 1 or multiple root AMs Each root AM has its own database connection and therefore transaction If you multiply this by the number of concurrent users this can limit your scalability AMs can be nested under root AMs to logical group VOs But only the root AM is responsible for connections/transactions/AM pool Nested AMs delegate all such responsibilities to their root AM Image: IKunl/ FreeDigitalPhotos.net
  • 7. 7 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda Root and Nested Application Modules Number of Root Application Modules Application Module Connection Sharing Future Proofing Application Module Design Shared Application Modules
  • 8. 8 Copyright 2013, Oracle and/or its affiliates. All rights reserved. How many root AMs should your app have? Reasons to have multiple root AMs, you want: 1. Separate (> 1) transactions per user session 2. Separate (> 1) data sources in your app (rare) 3. Configure different tuning options dependent on VO usage exposed through the AM 4. Modularization (cylinder pattern)
  • 9. 9 Copyright 2013, Oracle and/or its affiliates. All rights reserved. How many root AMs should your app have? Reasons to have multiple root AMs, you want: 1. Separate (> 1) transactions per user session 2. Separate (> 1) data sources in your app (rare) 3. Configure different AM tuning options dependent on VO usage exposed through the AM 4. Modularization (cylinder pattern) Traditionally in 10g the only approach was to create multiple root AMs In 11g the isolated data control scope task flow option create separate instances of the same root AM for the same user This feature may make the need for multiple root AMs redundant
  • 10. 10 Copyright 2013, Oracle and/or its affiliates. All rights reserved. How many root AMs should your app have? Reasons to have multiple root AMs, you want: 1. Separate (> 1) transactions per user session 2. Separate (> 1) data sources in your app (rare) 3. Configure different AM tuning options dependent on VO usage exposed through the AM 4. Modularization (cylinder pattern) Arguably rare (but valid) requirement Still requires separate root AMs configured to access the different data sources Essential to use the task flow option otherwise the other task flow transaction options with a shared data control scope may consolidate the connection under the disparate AMs (More discussed soon)
  • 11. 11 Copyright 2013, Oracle and/or its affiliates. All rights reserved. How many root AMs should your app have? Reasons to have multiple root AMs, you want: 1. Separate (> 1) transactions per user session 2. Separate (> 1) data sources in your app (rare) 3. Configure different AM tuning options dependent on VO usage exposed through the AM 4. Modularization (cylinder pattern) Possibly taken care of by shared AMs Be aware of the automagical nesting of AMs and task flow transaction options (besides ) Under 11gR1 each root AM is nested under the first task flow root AM Under 11gR2+ (inc 12c) each root AM maintains itself as root with separate AM pools http://bit.ly/automagicAMnest1 http://bit.ly/automagicAMnest2 http://bit.ly/automagicAMnest3
  • 12. 12 Copyright 2013, Oracle and/or its affiliates. All rights reserved. How many root AMs should your app have? Reasons to have multiple root AMs, you want: 1. Separate (> 1) transactions per user session 2. Separate (> 1) data sources in your app (rare) 3. Configure different AM tuning options dependent on VO usage exposed through the AM 4. Modularization (cylinder pattern) The cylinder pattern proposes separate model layers for each cylinder Allows large teams/developments to not have dependencies on each other Not actually possible to nest AMs under a single root AM without creating an intermediary model layer to re- group AMs this results in as many connections as root AMs We can use the BTF transaction options to solve this (next section)
  • 13. 13 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Program Agenda Root and Nested Application Modules Number of Root Application Modules Application Module Connection Sharing Future Proofing Application Module Design Shared Application Modules
  • 14. 14 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Automatic ADF BC Root AM Connection Sharing If an application contains multiple root AMs all connecting to same db Possibly forced upon the application architecture by breaking the application into self contained BTF workspaces A single page consuming multiple BTF workspaces will spawn a large amount of database connections seriously limiting scalability If BTF transaction options are used (Not ) ADF will automatically merge the AM connections Throws runtime error if the root AMs dont share same JNDI Radically reduces the number of connections
  • 15. 15 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Automatic ADF BC Root AM Connection Sharing Validate this behavior by: (With ADF Source Code) Place breakpoint on oracle.jbo.server.DBTransactionImpl.establishNewConnection() Or watching connections at the db level: SELECT * FROM v$session WHERE username = 'HR'; Be mindful the BTF No save point upon task flow entry option when unselected may result in an extra internal connection If you dont want this behavior, for example: You need to separate data sources (different databases) Or youre comfortable with the older 10.1.3 root AM design Use
  • 16. 16 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Automatic ADF BC Application Module Nesting How this is achieved is through some trickery under the ADF BC covers The implementation of this has changed between releases Programmers can accidentally fall afoul in transitioning from 11gR1 to 11gR2 or 12c 11gR1 functionality commonly referred to Automagical AM nesting Image: arztsamui / FreeDigitalPhotos.net
  • 17. 17 Copyright 2013, Oracle and/or its affiliates. All rights reserved. Automatic AM Nesting Behavior 11gR1 Behavior for 11gR1 (Pre 11.1.2) 1st AM data control used becomes the master root AM of the data control frame Subsequent AM data controls within the same shared BTF chain will automatically nest regardless under the master even if theyre defined as a root AM As there is only 1 root AM at runtime, only one AM pool will be required Implies you do not need to tune the AM pool of every root AM Be careful that the root AM you think will become the master root AM does get used first, otherwise a non tuned root AM will become the master As there is only 1 root AM the connection of the root AM data control is used for all the nested AMs (the same as normal AM nesting behaviour) This highlights a limitation if the root AMs require different data sources, this automatic behavior me

Recommended

View more >