Since Oracle Application Express 2.2, all metadata defining your applications are exposed by means of the (new) data dictionary views. This opens perspectives to set-up your own Quality Control System to enhance the development process.
When starting the development of a new application, one of the first actions you always do is set up naming conventions, coding standards and best practices. This paper will explain how to increase the overall quality of your application by verifying the compliancy of your development team’s work to those outlined standards. Those checks can be implemented by queries against the apex repository views visualized in a custom QA application ... developed in Apex of course.
(created by iAdvise)
Developer Data Modeling Mistakes: From Postgres to NoSQL
Use the Power of APEX Dictionary Views to Increase the Quality of Your APEX Applications
1. Use the Power of APEX
Dictionary Views to
Increase the Quality of
Your APEX Applications
Karen Van Hellemont
Your Oracle Solutions Partner Jan Huyzentruyt
2. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
2
3. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
3
5. Who is iAdvise?
• Started in 2004
Cronos is
• Member of The Cronos Group
Our Company iAdvise
• Oracle-based solutions
• 50 Oracle specialists today
• Turnover of € 4.500.000 (± $ 7.000.000)
• End 2007 – O2U in The Netherlands
Now 15 consultants
5
6. How do we work?
• Stress on people
– Mix of young potentials and experienced “coaches”
– Maximum training, close follow-up
Our Company iAdvise
– Knowledge sharing!
• Finding the equilibrium between solutions and
technology
• Initiatives to stay ahead
– Certified consultants
– Competence centers with “core” teams
– Fusion Regional Director
– Seminars and sessions at Oracle events
– Oracle Blog
6
7. How do we work?
RAD Race 2007-2008
Our Company iAdvise
7
8. Competence Centers
Classic
Development
• SQL, PL/SQL
Our Company iAdvise
• Designer
Additional • Forms
New
Services • Reports Technology
• APEX development
• Oracle Portal
Development • Java - J2EE, OC4J,
frameworks
• High Level Consultancy
• SOA, BPEL, BAM
• Oracle Licenties
• WebCenter
Oracle
Platform
Datawarehouse
& BI Infrastructure
• Architecture and design • Oracle AS Admin
• ETL – OWB, ODI • Monitoring, Tuning
• BI Suite (Dashboard, • Hosting
Answers)
8
9. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
9
10. Apex Development Approach
Why?
Apex Development Approach
• Reason 1:
– Every company is looking for a custom project and
development approach
– Main Objective is:
“Reach the desired result
in the fastest and best possible way
without exceeding the budget and
with an acceptable quality level”
10
11. Apex Development Approach
Why?
Apex Development Approach
• Reason 2:
– The entrance level for learning Apex is very low
– A lot of our junior developers get their first project
experience in an Apex context
“There is a need for supervision and guidance”
11
12. Apex Core Team
• With Apex as development tool you can realize
Apex Development Approach
projects
– At a good price
– Within an aggressive time frame
• Apex Core team: young people
– Talented
– Motivated
– Enthusiast
– Full of energy
12
13. Apex Core Team
• But they need
Apex Development Approach
guidance + supervision
• One tries to equip project team members with
tools & techniques
• Create a development workplace to efficiently
pilot and control the development process
13
14. Project Workplace
Looking for a standard way of working based on:
Apex Development Approach
Project Project
Methodology Workplace
14
15. Project Workplace
A typical project
Apex Development Approach
workplace looks like
a workbench where
all necessary materials
are available
15
16. Pan-Ora-Mix
• Started an internal project
Apex Development Approach
• Code-name “Pan-Ora-Mix”
“Brings together all kinds of
Oracle knowledge spanning
several years of Apex
project experiences and
blend it together to a magic potion…”
16
17. Pan-Ora-Mix
Ingredients of that magic potion are:
Apex Development Approach
• Sample apex applications
– Packaged applications that can be downloaded from http://
apex.oracle.com
– Applications already built by iAdvise
• Add-ons and toolsets
– pGen4O (PL/SQL Generator)
– IAF (reusable components for Apex)
– xTra4o (Xliff Translator): http://www.iadvise.be/xtra4o
– BiP4Apex (Application document generator via BiP)
– Qa4o (QA Check)
• Tips, guidelines, standards, best practices
17
18. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
18
19. Apex Conventions
• At the beginning of a new Apex-project some
Apex Development Standards
development standards are needed, like
– Coding style conventions
– Naming conventions
• Originally we used a standard form, but
– How can you check that these standards are
followed?
• A more automated approach is needed
19
22. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
22
23. The Apex Repository
Apex stores all the metadata of the
application in a repository within the database,
owned by the FLOWS_xyz schema. Tables in
the FLOWS-schema are not public and are
not quite “readable”.
Since Apex 2.2 Oracle implemented a more
The Basic Idea
accessible layer: the so-called Apex
repository views. They are recognizable by
the prefix ‘APEX_’ and are all made public.
With the release of Apex 3.0, the views are
also documented within the tool (see Home>
Utilities> Apex Views).
23
25. The Apex Repository
• Apex dictionary views can be grouped in different areas
• Everything a developer “programs” can be queried
via those APEX_APPLICATION_xxx views
The Basic Idea
= Basic foundation to set-up a
Quality Assurance System for controlling
whether the development standards are
respected
25
26. Step 1: Writing Queries
• Step 1: We write queries on the Apex dictionary
views which contain development standards
• Example 1:
– We want to find regions that are not based on the
template “Reports Region”
The Basic Idea
– Therefore we query the view
APEX_APPLICATION_PAGE_REGIONS and look
at the template column
26
27. Step 1: Writing Queries
SELECT xapg.page_id,
xapr.page_name,
xapr.region_name,
xapr.source_type,
xapr.template as wrong_value,
xapp.application_id as apex_app_id
FROM apex_application_page_regions xapr
The Basic Idea
JOIN apex_application_pages xapg ON
(xapg.page_id = xapr.page_id AND
xapg.application_id = xapr.application_id)
JOIN apex_applications xapp ON xapp.application_id =
xapg.application_id
WHERE xapg.page_id <> 0 -- exclude page zero
AND xapr.source_type IN ('Report', 'Tabular Form', 'PL/SQL')
AND xapr.template NOT LIKE 'Reports Region'
27
28. Step 1: Writing Queries
• Example 2:
– We want to find regions where the pagination
scheme is different from “Row Ranges 1-15 16-30 in
select list (with pagination)”
– Therefore we query the same view
The Basic Idea
APEX_APPLICATION_PAGE_REGIONS and look
at the pagination_scheme column
28
29. Step 1: Writing Queries
SELECT xapg.page_id,
xapr.page_name,
xapr.region_name,
xapr.source_type,
xapr.pagination_scheme as wrong_value,
xapp.application_id as apex_app_id
FROM apex_application_page_regions xapr
The Basic Idea
JOIN apex_application_pages xapg ON
(xapg.page_id = xapr.page_id AND
xapg.application_id = xapr.application_id)
JOIN apex_applications xapp ON xapp.application_id =
xapg.application_id
WHERE xapg.page_id <> 0 -- exclude page zero
AND xapr.source_type IN ('Report', 'Tabular Form', 'PL/SQL')
AND xapr.pagination_scheme <> 'Row Ranges 1-15 16-30 in
select list (with pagination)'
29
30. Step 2: Creating own QA-Views
• Step 2:
– We assemble all quality check queries
– We “UNION” them in our own QA-views
• Example:
The Basic Idea
– We want one view that checks the correct template
and pagination scheme
30
31. Step 2: Creating own QA-Views
CREATE OR REPLACE VIEW QA_APEX_APP_PAGE_REGIONS AS
SELECT …
FROM apex_application_page_regions xapr
JOIN …
WHERE …
AND xapr.template NOT LIKE 'Reports Region'
The Basic Idea
UNION
SELECT …
FROM apex_application_page_regions xapr
JOIN …
WHERE …
AND xapr.pagination_scheme <> 'Row Ranges 1-15 16-30 in
select list (with pagination)'
31
32. Step 3: Grouping Checks
• Step 3:
– We place different checks in different groups
– For each group we build a view, consisting of
different UNION’ed select statements
– Within each group we define checks, corresponding
The Basic Idea
with a specific select against the apex repository
32
33. Step 3: Grouping Checks
Check Groups with Corresponding QA-Views
Shortname Group QA View Name
APR Application Page Regions QA_APEX_APP_PAGE_REGIONS
APRC Application Page Rep QA_APEX_APP_PAGE_RPT_COLS
Columns
The Basic Idea
API Application Page Items QA_APEX_APP_PAGE_ITEMS
APP Application Page QA_APEX_APP_PAGE_PROC
Processes
APV Application Page QA_APEX_APP_PAGE_VAL
Validations
33
34. Step 3: Grouping Checks
Check Points within each Check Group
Group Identif. Code Quality Check
APR APR-001 Wrong Reports Region Template
APR APR-002 Wrong no_data_found_message
APR APR-003 Wrong maximum_rows_to_query
APR APR-004 Wrong pagination_scheme
APR APR-005 Wrong enable_csv_output
The Basic Idea
APR APR-006 Wrong report_null_value_as
APR APR-007 No ORDER BY - No Default sort sequence
APRC APRC-001 Wrong date format
APRC APRC-002 Wrong Heading Alignment
API API-001 Wrong date format in Date Picker
API API-002 Date column NOT based on Date Picker
APP APP-001 Verify (Length) PL SQL Source
APP APP-002 No Process Error Message
APV APV-001 Wrong error_display_location
... ... ...
34
35. Step 4: Running Queries
• Step 4:
– We can now run our custom defined QA-views
– The output shows the standards that aren’t
respected
– Example:
The Basic Idea
SELECT * FROM qa_apex_app_page_items
35
37. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
37
38. Visualize Checks via QA Appl.
• Time to give the queries to developers and
Custom Apex QA System
code reviewers
• Choose an integrated user interface: Apex
38
40. The QA Metamodel
• Two problems needed to be solved
Custom Apex QA System
– If someone invents a new check we don’t want to
replace one of the views (DDL)
– Different projects means different conventions, but
for new projects we don’t want to replace the views
(DDL)
• Solution: we create our own small metabase
40
41. The QA Metamodel
Custom Apex QA System
• This metabase stores the driving data for the
QA-application
• No DDL, but DML now
41
42. The metamodel in our QA-Viewer
• We added to our QA-Viewer an ADMIN tab
Custom Apex QA System
where the driving metadata tables can be
maintained
– Check Groups
– Check Points
– Parameters
42
46. Maintain Parameters
Custom Apex QA System
• Different standards can exist for different apex-
applications for the same customer
• Possible to store a different standard-value for
a specific application
(via APPLIED_PARAMETERS)
46
48. Convention Checklist
Custom Apex QA System
DEMONSTRATION
Working with Check Groups, Check Points,
Default Parameters and Application
Parameters
48
49. Agenda
• Our Company iAdvise
• Apex Development Approach
• Increasing the Quality of Apex Applications
– Apex Development Standards
– The Basic Idea
– From Basic Idea to Custom Apex QA System
• Conclusion
Agenda
49
50. Conclusion
• Apex is the ideal tool to realize projects
– with junior developers
– at a good price
– within an aggressive time frame
– with an acceptable quality level
• You can increase the quality of your
Conclusion
applications by the power of the dictionary
views
• iAdvise has built his own QA-Viewer
50
52. Thank you
• Hand in evaluation form
• More information:
– Whitepaper: vanhelle.doc
– Website: http://www.iadvise.be
– Blog: http://iadvise.blogspot.com
– Xliff Translator (free): http://www.iadvise.be/xtra4o
Thank you
– Email: karen.vanhellemont@iadvise.be
jan.huyzentruyt@iadvise.be
• General Apex information
– http://apex.oracle.com
52