open/closed software - developing freemium application using spring framework
DESCRIPTION
Speaker: Frederic Simon Developing freemium which involves OSS is not a trivial task. From one side, you need to prevent premium code from working in your free modules, and do it gracefully - without errors and performance degradation. From other side, your OSS core must be easily accessible to the premium modules. Partial public availability of the code and unified continuous delivery process for two different versions of the product is also challenging. In this talk we’ll showcase Artifactory, which successfully combines OSS and Pro versions by heavily relying on flexible dependency injection mechanics, available in Spring. We will talk about developing, building, testing and releasing hybrid freemium application and will review the existing approaches, discussing pros and cons of each of them.TRANSCRIPT
![Page 1: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/1.jpg)
© 2013 SpringOne 2GX. All rights reserved. Do not distribute without permission.
Open/Closed Software Developing a freemium application with Spring
![Page 2: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/2.jpg)
Your Speaker
● Fred Simon
– Chief Architect, JFrog
– @freddy33
● github.com/freddy33
![Page 3: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/3.jpg)
Agenda
● History of a freemium application
● OSS base of the architecture
● Reloadable
● Commercial Addons
● Layers... More layers!
● Testable
![Page 4: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/4.jpg)
Artifactory History
● 2006: The OSS version
● 2008: First “professional” OSS version
● 2009: The SaaS version then the Pro
● 2012: Bintray
● 2013: The 3.0 version
● 2013: The HA version
![Page 5: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/5.jpg)
OSS is the base
● The core engine for all
– UI,
– Spring TX
– Spring Security
– Transactional VFS
– Security
![Page 6: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/6.jpg)
Architecture
● Based on Spring and IoC from the start
● Highly modular
● SaaS => No static members!
● A spring context (and Wicket application) is the
app
![Page 7: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/7.jpg)
Reloadable Beans
● Artifactory Configuration => Spring Beans
configuration
● Reloading beans
● No singletons ;-)
![Page 8: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/8.jpg)
Converter Manager
● Since 2.0 (2009) drop the war
– DB auto-update
– Configuration schema and default change
● Config, Logback, Mimetypes
– Directory structure changes
● 3.0 (2013)
![Page 9: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/9.jpg)
Version Converter Matrix
● I like Enums (See the extended Enums ;-)
● Branches are hard
● Keeping it Modular (Reloadable Beans)
![Page 10: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/10.jpg)
Addons Manager
● Addons are pure interfaces <=> features
– Multiple implementations
– One manager that from classpath + license load the correct addon
● Each addon has:
– META-INF/addon.properties
– Addon.xml (Spring beans)
– Many annotated spring beans
![Page 11: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/11.jpg)
Extending the UI
● Using Wicket dynamic loading
● Addon provides HTML and Java code for extended
page/panel
![Page 12: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/12.jpg)
REST API
● Jersey
– All resources in the OSS version in a single jar
● Because of IBM WebSphere ;-(
– Jersey actually load all path correctly
– Jersey annotation parsing 60% of load time!
● => Reflections
● Jersey Spring integration use the Addon Manager
![Page 13: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/13.jpg)
More Layers...
● The HA and Online SaaS versions
● Just more addons
![Page 14: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/14.jpg)
Tests are everything
● Your software is defined by your tests
![Page 15: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/15.jpg)
Users Plugins
● Extensible Software
– Entry/Exit points
– Listeners
– Interceptors
– Extra REST API and Scheduled Jobs
![Page 16: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/16.jpg)
Unit Tests
● Unit tests for each module
– Spring Config with classpath filters
● Testing conversion
● Stabbing with Easymock
![Page 17: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/17.jpg)
Versions Integration Tests
● For each version
– Make sure the classpath are accurate (Maven hell ;)
– Adding new functionality tests from the previous base
● Testing remote HTTP calls: MockServer
– Slow network
– Broken sockets
– Basic HTTP response codes and headers
![Page 18: Open/Closed Software - Developing freemium application using Spring Framework](https://reader034.vdocuments.site/reader034/viewer/2022051816/546d246bb4af9f6b2c8b5262/html5/thumbnails/18.jpg)
Higher Tests
● Integration tests for REST, Replication and HA
– Running multiple web servers
– For multiple databases
– Backward and Forward compatibility