• Like
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6

  • 7,224 views
Published

Rakuten Technology Conference 2013 …

Rakuten Technology Conference 2013
"Financial Web System with Java EE 6"
Hirofumi Iwasaki (Rakuten)

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
7,224
On SlideShare
0
From Embeds
0
Number of Embeds
14

Actions

Shares
Downloads
19
Comments
1
Likes
8

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Hello, let's get started my presentation. "Financial web system with Java EE 6".
  • My biography. I'm a financial system vice group manager of Rakuten.And a professional of enterprise financial system management, planning and development.
  • This is agenda. First, I'll talk about the Java EE 6 specs, second, financial requirements and Java EE specs, and last, how to apply EE 6 to real financial systems.
  • Next.
  • What is Java EE. The answer is "standard spec for applications servers", but unfortunately, Microsoft excluded. They worked together for EE specs, but unfortunately, parted in anger at the end of 20th century.
  • What is "Enterprise"?At first, enterprise requires transactional system, and it represented by EJB with JTA container managed transaction.And each Java EE specs convers general enterprise requirements.
  • This is history of Java EE. The first name is JPE, Java Professional Edition in 1998, and the revised first version is J2EE 1.2.Before the J2EE, NetBeans and WebLogic were already released, and after J2EE, many products and libraries were born.But after J2EE 1.3, Microsoft released .NET Framework, and confused the Java EE world with many blames about the configuration complexity.After Oracle acquired Sun, they cleared the complexity and united under a single specification again.
  • This is the grouping of the Java EE products. 3 big servers are WebLogic by Oracle, WebSpehere by IBM, and JBoss by Red Hat, and additional Japanese group.And these have free open source version, GlassFish, Geronimo, and WildFly. Their competitors are Google App Engine, and Microsoft .NET Framework.
  • And each app server target spec is as shown. Very complex.And the de-facto latest version is Java EE 6. Generally, if you want to plan JEE system, consider EE 6 firstly.Anyway, I want to reflect these version matrix to Wikipedia.
  • Next, financial requirements and Java EE specs.
  • Here at Rakuten, we have 6 big services of financial.Rakuten Card, Rakuten Bank, Rakuten Edy, Rakuten Security, Rakuten Life, Rakuten Insurance.
  • Each service has many enterprise systems including Java EE.And each enterprise services has huge transactions.Especially almost web front-end is twenty-seven non-stop services.
  • Let's dig a little deeper. The big 3 requirement of Rakuten financial systems.First, rapid changeable logics, Second, huge request expansion capacity, and last, transactional.Very hard requirements for systems.
  • Historically, Japanese held these periodic re-construction in many areas, like a "式年遷宮" at Japanese shrines.We planned that our financial systems should be done in the same way for the next 3 big targets.
  • We aim to realize the system which is sustainable, flexibility and transparent to catch some errors immediately.And these are not only the new architecture, but the requirements.
  • Then let's see the typical usage of Java EE 6 specs.Almost all enterprise systems requires data source, and each source type requires suitable framework, JPA, JMS, RMI-IIOP and JAX, and Java Mail. And these data connectivity framework operated transactionaly by EJB.Finally front-end frameworks like JSF & JavaFX call EJB. These are the basic Java EE structure.
  • And the EJB interfacescan be considered as the 'services', or 'web API'.It doesn't have any user interface, only has pure data interfaces.
  • And some interface must be re-used by another interface, view, or functions. Called 'Shared functions'.We called these design as 'API-nization'.This is a required basic strategy for the enterprise systems to re-use business logics.
  • Next shows enterprise transactional model.This is a very basic model for the transaction processes, begin (or start) & commit.
  • If some error occurred, all processing data must be roll backed completely and safely.It means one or zero, or all or nothing.These basic operations must be implemented to core financial systems completely, or some financial data, especially some money data, must be broken.
  • Next, consider the real financial systems. It has many data sources, including some databases, message queue servers, and other transactional systems.When a transactional service which is calling some transactional services called, the local transactions must be gathered.It is called global transaction.
  • Of course this complex model also has transactional abilities.If some database or MQ or services fails with some error, all data source must be roll backed.This is the huge financial requirements.
  • And the Java EE supports this big structures.Each data source calling supported by JPA, JMS and RMI-IIOP, and operated by EJB and JTA.As you might know, Java EE core specification is still EJB, not Servlet or JSPs.
  • Next, the last part, how to apply Java EE 6 to real financial systems.
  • I planned the Java EE to real financial systems, with these 5 big issues.1st, policies, 2nd, education, 3rd, architecture, 4th, environment, and 5th, test.
  • 1st, policies. In the case of Rakuten, we have a policy, "internal development first". Of course, financial systems also. No basic policies to throw external vendors.We must clear this core policies, and consider the next solutions to run.
  • 2nd, educational issues. Read, read, and read.There's many good Java EE books in book stores, but English book only, not Japanese.Fortunately, we already changed our standard language to English, and many programmer can read them.
  • And there are many useful articles in world wide web.Thanks to the NetBeans team, nice tutorial are still in the web site.Refer to this site if you want to start Java EE development.
  • 3rd, I designed to apply Java EE 6 specs to the new architecture.Basic structure is obeyed to standard architecture, and applied front-end to JSF.And due to the no rich client requirement, I skipped JavaFX spec.
  • We had some older systems to integrate to the new architecture.In the PHP case, we designed each from PHP business logics to the EJB API codes. Full rewriting, 100% API-nized for re-use & collaborating services in the future.
  • We also re-designed the application module blocks. Center API-nized logics, with many front-ends. All business logic designed as API, with SOAP, REST, and IIOP protocol access enabled for future service-oriented architectures to simplify.
  • For the ease of development, we adopt the new IDE, NetBeans 7 with Apache maven automatic building systems. And we build full local programming environment to easy coding & run for rapid programming.
  • We made the easy startup environment to reduce startup costs.If some programmer attends the project, 2. just download from git server, 3. install tools, and 4. refer to JIRA for his or her for today's task management.
  • And to educate the accurate programming manners,we introduced Jenkins auto-building server with static security analyzers, Sonar & VeraCode. And we achieved zero violations before the new system release.
  • Ok, we have some additional time to talk to the real Java EE 6 world. Unveiled.
  • Is the Java EE 6 useful? for real project?My answer is for the backend, it is so-so, but for the web front-end, it is difficult. I want to say "wait the Java EE 7".
  • The reasons. 2 big problems found in our real projects.First, JSF backing bean conflict CDI managed bean specifications.Second, JSF HTML-styled tags were changed in JSF 2.2.
  • 1st issue, JSF backing bean defectively. When some facelet or managed bean set to the session scoped bean, the filter cannot access to the session scoped bean directly.
  • Some blogs and web sites shows these codes to access backing bean from non-JSF objects, but not worked properly in JSF 2.So we must override phase listeners for filtering, but very harmful and uncertain codes required.
  • Of course you can switch the backing bean from JSF managed bean to CDI bean.But unfortunately, Java EE 6 CDI didn't have @ViewScoped annotations, so we cannot use one-by-one style with facelets.I cannot understand this conflicted situation in EE 6.
  • In EE 7, these conflicts are already cleared and well integrated with JSF and CDI.CDI added @ViewScoped annotation to access one-by-one style with facelet.This strategy must be considered in the first JSF, but achieved in Java EE 7. It's too late for us!So wait for the Java EE 7 if you can.
  • Java EE 6 has some irregular tags named 'jsfc'.Java EE 7 JSF 2.2 changed these silly tags to XML schema compliant style. It's good for applying standards, but there's many cost required for updating from JSF 2.1.So, you should start from Java EE 7 if you can.
  • In the contrary, back-end side of java EE 6 seems almost been completed as its requirement for enterprise systems. EJB, JTA, JPA, JMS are already established the basic style, and just a small improvements in EE 7. Please start right away from EE 6 for background!
  • Last, here's my conclusion.
  • Java EE 6 is suitable for huge financial systems.And we made new financial architecture with many education and measurements.Make our enterprise future with Java EE.
  • That's all. Thanks for listening, have a good day.

Transcript

  • 1. Financial Web System with Java EE 6 Hirofumi Iwasaki Financial Service Department, Development Unit, Rakuten, Inc. http://www.rakuten.co.jp/
  • 2. Speaker Biography  Hirofumi Iwasaki – Vice Group Manager, Technology Manager – Financial Service Department, Development Unit, Rakuten, Inc.  Carrier – Planning, designing & implements for many huge enterprise systems for financial, manufacturer, public systems with enterprise middleware, especially Java EE & .NET in Japan for about 15 years.  Opus, Lectures, etc. – Magazine: @IT (2005-2010), CIO Magazine (2009), IT Architect (2005-2009), Web+DB Press (2005), Java World (2001-2004), etc. – Lectures: WebLogic key person roundtable (2012-2013), etc. – twitter: @rockcape 2
  • 3. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems 3
  • 4. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems 4
  • 5. What's Java EE (1/2)  Standard specifications for application servers (except for MS). Java EE Specification Commercial etc. Open Source 5
  • 6. What's Java EE (2/2)  For ENTERPRISE systems (Enterprise Edition) specifications (full profile) – 'Enterprise' means transactional. – Core architecture is EJB (JTA & CMT) with auto transaction systems. – Transactional connectivity for other systems with JPA (JDBC), JMS, RMI-IIOP. – Web architecture with JSF (Servlet & Facelet), JAX.  Each Java EE specification covers general enterprise requirements. 6
  • 7. The History of Java EE J2EE 1.2 (1999) Born! J2EE 1.3 (2001) Pandemic Era J2EE 1.4 (2003) Java EE 5 (2006) Mess Era (for EE spec) Java EE 6 (2009) Java EE 7 (2013) Integration Era Unite to Single Standard Again! 7
  • 8. Grouping of the Java EE Servers App Engine WebLogic World GlassFish & Compatible Group Geronimo & Compatible Group Copy Japan Galapagos Group JBoss World 8
  • 9. Java EE Application Servers Versions Vendor App Server EE 1.4 (2003-) EE 5 (2006-) EE 6 (2009-) EE 7 (2013-) Open Source GlassFish - 2.x 3.x 4.0 Oracle WebLogic 9.x 10.x 12.x - IBM WebSphere 5.1 6.x, 7.x 8.x - Red Hat JBoss 4.x 5.1 7.1 - Fujitsu Interstage 9.0,9.1 9.2,10.x,11.0 11.1 - Open Source Geronimo - 2.x 3.x - Hitachi Cosminexus 7.x 8.x 9.x - The de facto latest version is EE6 9
  • 10. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems 10
  • 11. Financial Services of Rakuten Group 11
  • 12. Financial Services of Rakuten Group  Big 6 Services  Each has huge transactions  24/7 non-stop services 12
  • 13. Requirements for Rakuten Financial Systems Financial Systems 1. Rapid business logic changeable as business model changes 2. Huge request capacity as business grows 3. Must be transactional 13
  • 14. For our 3 Big Targets Like periodic re-construction known as "Shikinen-Sengu" in Japan. E.g. Re-construct to next place once every 20 years in Ise-Shrine Re-construct New! Photo by author (2009 in Ise-Shrine) 14
  • 15. 3 Big Targets for New Architecture ① sustain ability ③ System Transpa rency for new Arch. ② Flexibil ity 15
  • 16. Typical Usage of EE 6 Specs Business Logic (no presentations) Web Presentation (no business logics) Data Access Call JPA DBs Call JSF EJB Rich Clients (no business logics) Messaging MQ Connection RMI-IIOP Call Java FX Call JMS JAX Automatic Transaction JavaMail Other Servers Call MTA EMail JTA Call 16
  • 17. Applying Service Oriented Architecture Business Logic (no presentations) Web Presentation (no business logics) Data Access Call JPA DBs Call JSF EJB Messaging Design asJMS Services Connection (aka 'API') Rich Clients (no business logics) RMI-IIOP Call Java FX JAX Automatic Transaction JavaMail MQ Call Other Servers Call MTA EMail JTA Call 17
  • 18. Simplified Model Rich Clients (no business logics) Web Presentation (no business logics) Service Interfaces A Shared Function Design as Services (aka 'API')  Full Service ('API-nization')  Re-use one business logic for another front-end 18
  • 19. Enterprise 'Transactional' Model Transaction Boundary Client (caller, views or so) BEGIN SELECT DELETE Transactional Services UPDATE COMMIT 19
  • 20. Enterprise 'Transactional' Model (Error Case) Client (caller, views or so) BEGIN SELECT DELETE ROLLBACK Transaction Boundary Transactional Services UPDATE ERROR No Data Broken Model 20
  • 21. Distributed Transaction Model Database 1 BEGIN Transactional Services Database 2 MQ Global Transaction Other Transactional Service 21
  • 22. Distributed Transaction Model (Error Case) BEGIN ERROR Transactional Services ROLLBACK Database 1 Database 2 Local Transaction MQ Global Transaction Other Transactional Services No Data Broken Model 22
  • 23. Each Technology & Java EE Specs Core Spec is EJB JPA BEGIN Transactional Services JPA Database 1 Database 2 EJB Local Transaction JMS MQ Automatic EJB Transaction RMI-IIOP Global Transaction = Container Managed JTA Transaction (CMT) Other Transactional Services 23
  • 24. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems 24
  • 25. 5 Big Issues to Apply New JEE Architecture 25
  • 26. 1. Policies: Case of Rakuten  Internal Development First, not order to external SI vendors. (Group All)  Financial businesses are also the target for the application of this policy. ORDER NO Educate & Develop 26
  • 27. 2. Education: Read, Read, Read! Start from HERE 4th Edition Good & Only Japanese EE 6 book Good Pocket Reference! For NetBeans 7 with EE 6 RECOMMENDED for WebLogic 12c 27
  • 28. 2. Education: Online Materials Original Tutorial for Newbies (Start here!) NetBeans Java EE docs for Advanced Information 28
  • 29. 3. Architecture: Apply EE 6 Specs Business Logic (no presentations) Web Presentation (no business logics) Data Access Call JPA DBs Call JSF EJB Rich Clients (no business logics) Messaging Call JMS MQ Connection RMI-IIOP Call Java FX There's no rich clients JAX Automatic Transaction JavaMail Other Servers Call MTA EMail JTA Call 29
  • 30. 3. Architecture: Migrate from Old Old Arch (e.g. PHP case) Spring PHP DAO Transaction Boundary JSF 2 Logic View New Arch EJB 3 + JPA External DB External View Services (aka APIs) DB Fully Re-written 100% API-nized 30
  • 31. 3. Architecture: Simplified Web Site A Web Site B Internal Site Batch Exec Core Services (aka APIs) L7 Balancer Reverse Proxy Front Real-time System B Gateway Database System C Sub Proc Front Batch 31
  • 32. 4. Environment: Ease of Dev. Full Local Programming, Build & Execute support = X X 32
  • 33. 4. Environment: Easy Startup 2. Download Code from Repository 4. Refer the JIRA as for his today's task improvement 1. Join a project. 3. Install JDK with IDE, App servers, build, and run on you local PC 33
  • 34. 5. Test: Full Auto Testing &Valid. 1. Auto PULL 4. Report Hourly ZERO Violations! 3. Auto Validate 2. Auto Build & Test Management Server 34
  • 35. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems Appendix: Java EE 6 Unveiled 35
  • 36. Is Java EE 6 Useful for Real Projects? Web Front End Wait the Java EE 7 Back End Not Bad 36
  • 37. Why you should wait the EE 7 for front-end? 37
  • 38. 1st Issue: JSF Backing bean defectively in EE 6 Java EE 6 (JSF 2.1) Facelet Filter Faces Servlet Managed Bean @View Scoped Facelet Managed Bean @View Scoped Facelet Managed Bean @View Scoped Phase Listeners Managed Bean @Session Scoped JSF World 38
  • 39. 1st Issue: JSF Backing bean defectively in EE 6  Not worked these JSF 1.x codes in JSF 2.x properly. protected FacesContext getFacesContext(HttpServletRequest request, HttpServletResponse response) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext == null) { FacesContextFactory contextFactory = (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); LifecycleFactory lifecycleFactory = (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); Lifecycle lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); facesContext = contextFactory.getFacesContext(request.getSession().getServletContext(), request, response, lifecycle); // Set using our inner class InnerFacesContext.setFacesContextAsCurrentInstance(facesContext); // set a new viewRoot, otherwise context.getViewRoot returns null UIViewRoot view = facesContext.getApplication().getViewHandler() .createView(facesContext, ""); facesContext.setViewRoot(view); } return facesContext; } 39
  • 40. 1st Issue: JSF Backing bean defectively in EE 6 Java EE 6 (JSF 2.1) NG! CDI don't have @View Scoped Facelet Filter Faces Servlet Phase Listeners NG! CDI don't have @View Scoped Facelet NG! Facelet Managed Bean @Session Scoped OK! CDI don't have @View Scoped Integrated CDI World 40
  • 41. 1st Issue: JSF Backing bean defectively in EE 6 Java EE 7 (JSF 2.2) OK! Facelet Filter Facelet New CDI @View Scoped Facelet Faces Servlet New CDI @View Scoped New CDI @View Scoped Phase Listeners CDI @Session Scoped OK! Wait the Java EE 7 if you can Integrated CDI World 41
  • 42. 2nd Issue: Non-interchangeable Facelet tags in EE 6 Java EE 6 (JSF 2.1) <input type="text" jsfc="h:inputText" name="id" value="#{bean.property}" /> Java EE 7 (JSF 2.2) Changed! <input type="text" jsf:id="id" jsf:value="#{bean.property}" /> Wait the Java EE 7 if you can 42
  • 43. How's Back End in EE 6? Business Logic (no presentations) Data Access Call JPA DBs Call EJB Messaging Call JMS MQ Connection RMI-IIOP Call JAX Automatic Transaction JavaMail Other Servers Call MTA EMail JTA Call 43
  • 44. Agenda 1. Java EE 6 Specifications 2. Financial Requirements & Java EE Specifications 3. How to Apply Java EE 6 to Real Financial Systems Appendix: Java EE 6 Unveiled Conclusion 44
  • 45. Conclusion  Java EE 6 is suitable for huge financial systems.  We made new financial architecture with many measurements  Wait for the EE 7 servers if you can Go Ahead, Ride the Wave! Make our enterprise future with Java EE! 45
  • 46. 46