Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bringing a Legacy Java Application to 2015

Bringing a Legacy Java Application to 2015

João Carvalho

April 23, 2015
Tweet

More Decks by João Carvalho

Other Decks in Programming

Transcript

  1. Bringing a Legacy Java Application to 2015 PT JUG -

    23 Abril 2015 João Carvalho Chief Software Architect - FenixEdu
  2. Presentation Tier — Based on Struts Application Tier POJO’s Persistence

    Tier — Based on OJB XML Configuration Service Manager Services Filters XML Configuration DTO’s XML Configuration Data Repository JDBC JSP Views Actions SQL Statements
  3. A new feature in 11 simple steps 1. Create a

    POJO to represent the domain object 2. Write the SQL schema to store the domain object 3. Write the xml configuration to map the POJO against the SQL schema 4. Write SQL statements for custom reading of the domain object (in case something other than a read by ID or a read all was necessary) 5. Create data transfer objects for passing information to the presentation tier 6. Write services at the application level for creating, reading, updating and deleting the domain object 7. Write access control filters to limit who can invoke services 8. Write service and filter configurations in a xml file 9. Create JSP views for presenting information to the users 10. Write Actions to handle user requests 11. Configure struts xml files to specify the application flow
  4. Modularity Native Java ORM Highly Consistent Persistent STM Multiple Persistency

    Backends Transaction Management Consistency Predicates Transaction Introspection Lifecycle Events JSON Support Domain Introspection Opacity Isolation Conflict-free Reads In-Memory Fenix Framework
  5. DML • Declarative language to reify rich domain models •

    Java-like syntax • jOOQ-style code generation
  6. Classes public class User { protected String username (REQUIRED); protected

    String password; protected String salt; protected DateTime created; public LocalDate expiration; public String email; public Locale preferredLocale; } domain.dml
  7. Custom Types valueType java.util.Locale as Locale { externalizeWith { String

    toLanguageTag(); } internalizeWith forLanguageTag(); } OR valueType java.util.Locale as JsonLocale { externalizeWith { String getLanguage(); String getCountry(); } }
  8. Relations relation SystemUsers { protected Bennu playsRole bennu { multiplicity

    1..1; } protected User playsRole user { multiplicity *; } }
  9. STM Properties • Strict Object Equality • Simplified transaction control

    • Stronger correctness guarantees • No locking! • Conflict-free reads
  10. Presentation Tier — Based on Struts Application Tier Persistence Tier

    — Fenix Framework Based Service Manager Services Filters XML Configuration Domain Objects XML Configuration Data Repository JDBC JSP Views Actions DML Configuration
  11. • Long Compilation Times • Large Memory Requirements • Poor

    expandability • Poor encapsulation • Easy to break domain constraints
  12. • Separation of Concerns • Better Abstractions • Encapsulation •

    Independent Roadmaps • Development process improvements • Reusability
  13. User Management Legacy technologies integration Spring Struts Faces Agnostic storage

    support Cron Tasks Runtime manual tasks Domain Browser Messaging Event driven programming Modular System Portal Runtime modifable Menu Themable Runtime configuration User authentication REST infrastructure Full OAuth Stack Transactional IO Indexing Searching Internationalization Client Toolkit Bootstrap Bennu Fine grain user groups JavaScript pluggability WebSockets Multi Language
  14. Bennu • Web framework for Fenix Framework-based applications • Application

    Configuration and monitoring (including full domain browser and analytics) • Security: user management, logins, groups • Localization support • Full JAX-RS Integration and JSON Support • Multi-backend File Storage
  15. Bennu Scheduling • Similar to Quartz Scheduler • Standard Cron-Style

    tasks • Ability to execute custom code on the running application
  16. Bennu Extensions • Full OAuth2 server support • Nashorn support

    • Common Spring/JAX-RS argument converters • Configurable Exception Handling • Modular Application Bootstrap
  17. @Mapping(module = "public", path = "/findSpaces") @Forward(name = "listFoundSpaces", path

    = "/public/spaces/ findSpaces.jsp") public class FindSpacesDA extends DispatchAction { }
  18. Bennu Portal • UI Integration Framework • Uniform styling across

    the application • Dynamically configurable theme • Request Dispatcher/Router • Dynamic menu construction and rendering • Out-of-the-box scaffolding for web applications
  19. • UI Code declares what functionalities it exposes • Dynamic

    model built from declared functionalities • Auto-injected theme with full menu • Easily support many presentation technologies
  20. Bringing a Legacy Java Application to 2015 PT JUG -

    23 Abril 2015 João Carvalho Chief Software Architect - FenixEdu