Use the Power of APEX Dictionary Views to Increase the Quality of Your APEX Applications

52
Karen Van Hellemont Jan Huyzentruyt Your Oracle Solutions Partner Use the Power of APEX Dictionary Views to Increase the Quality of Your APEX Applications

description

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)

Transcript of Use the Power of APEX Dictionary Views to Increase the Quality of Your APEX Applications

Page 1: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

Karen Van Hellemont Jan Huyzentruyt Your Oracle Solutions Partner

Use the Power of APEX Dictionary Views to Increase the Quality of Your APEX Applications

Page 2: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 3: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 4: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

4

Who is iAdvise? O

ur C

ompa

ny iA

dvis

e Located in Belgium

Page 5: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

5

Who is iAdvise?

•  Started in 2004 •  Member of The Cronos Group •  Oracle-based solutions •  50 Oracle specialists today •  Turnover of € 4.500.000 (± $ 7.000.000) •  End 2007 – O2U in The Netherlands

Now 15 consultants

Our

Com

pany

iAdv

ise

Cronos is

Page 6: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

6

How do we work? •  Stress on people

–  Mix of young potentials and experienced “coaches” –  Maximum training, close follow-up –  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

Our

Com

pany

iAdv

ise

Page 7: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

7

Our

Com

pany

iAdv

ise

How do we work?

RAD Race 2007-2008

Page 8: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

8

Competence Centers

Oracle Platform

Classic Development • SQL, PL/SQL • Designer • Forms • Reports

New Technology • APEX development • Java - J2EE, OC4J, frameworks

• SOA, BPEL, BAM • WebCenter

Infrastructure • Oracle AS Admin • Monitoring, Tuning • Hosting

Datawarehouse & BI • Architecture and design • ETL – OWB, ODI • BI Suite (Dashboard, Answers)

Additional Services • Oracle Portal Development

• High Level Consultancy • Oracle Licenties

Our

Com

pany

iAdv

ise

Page 9: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 10: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

10

•  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” A

pex

Dev

elop

men

t App

roac

h Apex Development Approach

Why?

Page 11: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

11

•  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”

Apex Development Approach

Why?

Ape

x D

evel

opm

ent A

ppro

ach

Page 12: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

12

Apex Core Team

•  With Apex as development tool you can realize projects –  At a good price –  Within an aggressive time frame

•  Apex Core team: young people –  Talented –  Motivated –  Enthusiast –  Full of energy

Ape

x D

evel

opm

ent A

ppro

ach

Page 13: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

13

Apex Core Team

•  But they need guidance + supervision

•  One tries to equip project team members with tools & techniques

•  Create a development workplace to efficiently pilot and control the development process

Ape

x D

evel

opm

ent A

ppro

ach

Page 14: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

14

Looking for a standard way of working based on:

Project Methodology

Project Workplace

Project Workplace A

pex

Dev

elop

men

t App

roac

h

Page 15: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

15

A typical project workplace looks like a workbench where all necessary materials are available

Project Workplace A

pex

Dev

elop

men

t App

roac

h

Page 16: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

16

Pan-Ora-Mix

•  Started an internal project •  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…”

Ape

x D

evel

opm

ent A

ppro

ach

Page 17: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

17

Pan-Ora-Mix

•  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

Ingredients of that magic potion are:

Ape

x D

evel

opm

ent A

ppro

ach

Page 18: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 19: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

19

•  At the beginning of a new Apex-project some 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

Ape

x D

evel

opm

ent S

tand

ards

Apex Conventions

Page 20: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

20

Ape

x D

evel

opm

ent S

tand

ards

Convention Checklist

Example of a Convention Checklist

Page 21: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

21

DEMONSTRATION

Manually checking development standards using the convention checklist

Convention Checklist A

pex

Dev

elop

men

t Sta

ndar

ds

Page 22: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 23: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

23

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 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). Th

e B

asic

Idea

The Apex Repository

Page 24: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

24

The

Bas

ic Id

ea

The Apex Repository

Apex Dictionary Tree View

Page 25: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

25

•  Apex dictionary views can be grouped in different areas •  Everything a developer “programs” can be queried

via those APEX_APPLICATION_xxx views

= Basic foundation to set-up a Quality Assurance System for controlling whether the development standards are

respected The

Bas

ic Id

ea

The Apex Repository

Page 26: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

26

•  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” –  Therefore we query the view

APEX_APPLICATION_PAGE_REGIONS and look at the template column

The

Bas

ic Id

ea

Step 1: Writing Queries

Page 27: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

27

The

Bas

ic Id

ea

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

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'

Page 28: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

28

•  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 APEX_APPLICATION_PAGE_REGIONS and look at the pagination_scheme column

The

Bas

ic Id

ea

Step 1: Writing Queries

Page 29: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

29

The

Bas

ic Id

ea

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

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)'

Page 30: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

30

•  Step 2: –  We assemble all quality check queries –  We “UNION” them in our own QA-views

•  Example: –  We want one view that checks the correct template

and pagination scheme

The

Bas

ic Id

ea Step 2: Creating own QA-Views

Page 31: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

31

The

Bas

ic Id

ea

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'

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)'

Step 2: Creating own QA-Views

Page 32: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

32

•  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

with a specific select against the apex repository

The

Bas

ic Id

ea

Step 3: Grouping Checks

Page 33: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

33

The

Bas

ic Id

ea

Step 3: Grouping Checks

Shortname Group QA View Name APR Application Page Regions QA_APEX_APP_PAGE_REGIONS APRC Application Page Rep

Columns QA_APEX_APP_PAGE_RPT_COLS

API Application Page Items QA_APEX_APP_PAGE_ITEMS APP Application Page

Processes QA_APEX_APP_PAGE_PROC

APV Application Page Validations

QA_APEX_APP_PAGE_VAL

Check Groups with Corresponding QA-Views

Page 34: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

34

The

Bas

ic Id

ea

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 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 ... ... ...

Page 35: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

35

•  Step 4: –  We can now run our custom defined QA-views –  The output shows the standards that aren’t

respected –  Example: SELECT * FROM qa_apex_app_page_items

The

Bas

ic Id

ea

Step 4: Running Queries

Page 36: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

36

Step 4: Running Queries

Example: SELECT * FROM qa_apex_app_page_items

SQL Developer Output

Page 37: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 38: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

38

•  Time to give the queries to developers and code reviewers

•  Choose an integrated user interface: Apex

Cus

tom

Ape

x Q

A S

yste

m

Visualize Checks via QA Appl.

Page 39: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

39

DEMONSTRATION

Checking development standards using our own QA-viewer

Convention Checklist C

usto

m A

pex

QA

Sys

tem

Page 40: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

40

•  Two problems needed to be solved –  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

Cus

tom

Ape

x Q

A S

yste

m

The QA Metamodel

Page 41: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

41

•  This metabase stores the driving data for the QA-application

•  No DDL, but DML now Cus

tom

Ape

x Q

A S

yste

m

The QA Metamodel

Page 42: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

42

•  We added to our QA-Viewer an ADMIN tab where the driving metadata tables can be maintained –  Check Groups –  Check Points –  Parameters

The metamodel in our QA-Viewer C

usto

m A

pex

QA

Sys

tem

Page 43: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

43

Maintain Check Groups C

usto

m A

pex

QA

Sys

tem

Maintain Check Groups

Page 44: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

44

Maintain Check Points C

usto

m A

pex

QA

Sys

tem

Maintain Check Points

Page 45: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

45

Maintain Parameters C

usto

m A

pex

QA

Sys

tem

Maintain Default Parameters

Page 46: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

46

•  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)

Cus

tom

Ape

x Q

A S

yste

m Maintain Parameters

Page 47: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

47

Cus

tom

Ape

x Q

A S

yste

m Maintain Parameters

Maintain Application Specific Parameters

Page 48: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

48

DEMONSTRATION

Working with Check Groups, Check Points, Default Parameters and Application

Parameters

Convention Checklist C

usto

m A

pex

QA

Sys

tem

Page 49: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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

Age

nda

Page 50: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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 applications by the power of the dictionary views

•  iAdvise has built his own QA-Viewer

Con

clus

ion

Page 51: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

51

Questions and Answers Q

uest

ions

and

Ans

wer

s

Page 52: Use the Power of APEX Dictionary Views to  Increase the Quality of Your APEX Applications

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 –  Email: [email protected]

[email protected] •  General Apex information

–  http://apex.oracle.com Than

k yo

u