Rapid Development withActiveObjectsJason HinchDeveloper, Atlassian                         2
About Me• FishEye/Crucible front-end team • Java, Python and JavaScript• 18 months at Atlassian• Previously: • Confluence P...
Agenda• Why ActiveObjects?• What is ActiveObjects?• Getting Started• Defining an Entity• CRUD with ActiveObjects• Upgrade t...
The Idea• Bamboo data and actions  from FishEye/Crucible • Commit Graph • Changeset • Review • Triggering Builds          ...
Quick Demo             6
The First Problem• Fetching data from Bamboo • Dependency on External System • Large amount of data, fast• Cache data in F...
Previous Solutions• In Memory Cache• Flat Files (Java/XML/JSON serialisation)• SAL property sets• Plugin managed database ...
ActiveObjects                9
ActiveObjects - What?• Can refer to two different projects • ActiveObjects Library • Atlassian ActiveObjects Framework    ...
ActiveObjects Library• Lightweight ORM • Annotation based DDL • Create/Read/Update/Delete (CRUD) • Upgrades• Built on JDK ...
ActiveObjects Framework• Superset of ActiveObjects Library• Plugin data in the application database• Adds support for Atla...
AO Library vs Framework• ActiveObjects Library • net.java.ao* • http://java.net/projects/activeobjects/pages/Home• ActiveO...
Supported Products• FishEye 2.7.0 and above• Crucible 2.7.0 and above• JIRA 4.4 and above                             14
ActiveObjects Philosophy• Implements Active Record Pattern • Class/Interface maps to a table • Object instance maps to a r...
Getting Started                  16
pom.xml          17
atlassian-plugin.xml                       18
Defining an Entity                    19
Defining an Entity• Interface• Extends RawEntity (or subclass)                                    20
Entity interface                   21
RawEntity interface                      22
Entity -> SQL Table                      23
Entity -> SQL Table                      24
CRUD   Create   Read   Update   Delete                     25
Create         26
Read       27
Read       28
Update         29
Delete         30
Transactions               31
The Second Problem• Change Model between versions • Data Migration • Upgrades already run                                 ...
Upgrade Tasks• Versioned• Schema Migrations• Data population / manipulation                                   33
atlassian-plugin.xml                       34
ActiveObjectsUpgradeTask                           35
Importing Data                 36
Adding / Deleting• Entity • Add / Remove from ao.migrate call• Field • Add / Remove from Entity definition                 ...
Renaming           38
Renaming           39
Renaming           40
Renaming           41
Renaming           42
Third First Problem • Test the code • Multiple Databases • More Power & Trust -> More Responsibility                      ...
pom.xml          44
ActiveObjectsJUnitRunner                           45
Initialising Data                    46
Targeting a Database• May have specific requirements• Target all supported Databases• Set database via a Java property• -Da...
Takeaways• Set up ActiveObjects in your plugin• Build & evolve complex data structures• Unit test it against specific datab...
Contact Me• http://answers.atlassian.com • Tag with active-objects• Twitter: @j_hinch• https://studio.atlassian.com/browse...
Thank you!
Using Atlassian UAL and ActiveObjects for Rapid Plugin Development - AtlasCamp 2011
Upcoming SlideShare
Loading in …5
×

Using Atlassian UAL and ActiveObjects for Rapid Plugin Development - AtlasCamp 2011

1,537 views
1,383 views

Published on

The Atlassian Platform is full of great technologies to make your life easier. Learn how to leverage UAL and ActiveObjects as well as FishEye/Crucible's public SPI, in order to develop awesome plugins such as the new FishEye/Crucible to Bamboo integration plugin.

Jason Hinch, FishEye & Crucible Developer

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,537
On SlideShare
0
From Embeds
0
Number of Embeds
133
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Using Atlassian UAL and ActiveObjects for Rapid Plugin Development - AtlasCamp 2011

  1. 1. Rapid Development withActiveObjectsJason HinchDeveloper, Atlassian 2
  2. 2. About Me• FishEye/Crucible front-end team • Java, Python and JavaScript• 18 months at Atlassian• Previously: • Confluence Plugins • Perl Development 3
  3. 3. Agenda• Why ActiveObjects?• What is ActiveObjects?• Getting Started• Defining an Entity• CRUD with ActiveObjects• Upgrade tasks• Testing 4
  4. 4. The Idea• Bamboo data and actions from FishEye/Crucible • Commit Graph • Changeset • Review • Triggering Builds 5
  5. 5. Quick Demo 6
  6. 6. The First Problem• Fetching data from Bamboo • Dependency on External System • Large amount of data, fast• Cache data in FishEye • Storage • Backup & Restore 7
  7. 7. Previous Solutions• In Memory Cache• Flat Files (Java/XML/JSON serialisation)• SAL property sets• Plugin managed database 8
  8. 8. ActiveObjects 9
  9. 9. ActiveObjects - What?• Can refer to two different projects • ActiveObjects Library • Atlassian ActiveObjects Framework 10
  10. 10. ActiveObjects Library• Lightweight ORM • Annotation based DDL • Create/Read/Update/Delete (CRUD) • Upgrades• Built on JDK Technologies • Java Dynamic Proxies • JDBC 11
  11. 11. ActiveObjects Framework• Superset of ActiveObjects Library• Plugin data in the application database• Adds support for Atlassian application lifecycle • Backup/Restore • SAL Transactions • Plugin lifecycle 12
  12. 12. AO Library vs Framework• ActiveObjects Library • net.java.ao* • http://java.net/projects/activeobjects/pages/Home• ActiveObjects Framework • com.atlassian.activeobjects* • https://studio.atlassian.com/wiki/display/AO 13
  13. 13. Supported Products• FishEye 2.7.0 and above• Crucible 2.7.0 and above• JIRA 4.4 and above 14
  14. 14. ActiveObjects Philosophy• Implements Active Record Pattern • Class/Interface maps to a table • Object instance maps to a row in the table • Ruby on Rails, Django, CakePHP use this pattern 15
  15. 15. Getting Started 16
  16. 16. pom.xml 17
  17. 17. atlassian-plugin.xml 18
  18. 18. Defining an Entity 19
  19. 19. Defining an Entity• Interface• Extends RawEntity (or subclass) 20
  20. 20. Entity interface 21
  21. 21. RawEntity interface 22
  22. 22. Entity -> SQL Table 23
  23. 23. Entity -> SQL Table 24
  24. 24. CRUD Create Read Update Delete 25
  25. 25. Create 26
  26. 26. Read 27
  27. 27. Read 28
  28. 28. Update 29
  29. 29. Delete 30
  30. 30. Transactions 31
  31. 31. The Second Problem• Change Model between versions • Data Migration • Upgrades already run 32
  32. 32. Upgrade Tasks• Versioned• Schema Migrations• Data population / manipulation 33
  33. 33. atlassian-plugin.xml 34
  34. 34. ActiveObjectsUpgradeTask 35
  35. 35. Importing Data 36
  36. 36. Adding / Deleting• Entity • Add / Remove from ao.migrate call• Field • Add / Remove from Entity definition 37
  37. 37. Renaming 38
  38. 38. Renaming 39
  39. 39. Renaming 40
  40. 40. Renaming 41
  41. 41. Renaming 42
  42. 42. Third First Problem • Test the code • Multiple Databases • More Power & Trust -> More Responsibility 43
  43. 43. pom.xml 44
  44. 44. ActiveObjectsJUnitRunner 45
  45. 45. Initialising Data 46
  46. 46. Targeting a Database• May have specific requirements• Target all supported Databases• Set database via a Java property• -Dao.test.database=oracle 47
  47. 47. Takeaways• Set up ActiveObjects in your plugin• Build & evolve complex data structures• Unit test it against specific databases 48
  48. 48. Contact Me• http://answers.atlassian.com • Tag with active-objects• Twitter: @j_hinch• https://studio.atlassian.com/browse/AO 49
  49. 49. Thank you!

×