Understanding how wrapper libraries work helps you use them more effectively and even create your own.
The Bridge Pattern
Each wrapper consists of:
- Java classes for configuration
- JavaScript bridge for library interaction
- Event translation layer
Configuration Flow
- You set properties on Java objects
- Properties serialize to JSON
- JavaScript bridge initializes the library
- Events flow back through the bridge
Consistent Conventions
All wrappers follow the same patterns:
- Fluent setters return this
- registerListener() for events
- Jsonable for configuration objects
Conclusion
The wrapper architecture enables Oorian to integrate any JavaScript library while maintaining a consistent, type-safe Java API.