legacy renewal of central framework in the enterprise

44
Renewal of Legacy Frameworks An Experience Report GeeCon 2014 May 2014 Anatole Tresch

Upload: anatole-tresch

Post on 24-Apr-2015

56 views

Category:

Presentations & Public Speaking


0 download

DESCRIPTION

Speak done at GeeCon and other Conferences in 2014 showing an experience report of some of the complexities to be faced when changing commonly used frameworks and runtime components in Credit Suisse and how issues were solved finally.

TRANSCRIPT

Page 1: Legacy Renewal of Central Framework in the Enterprise

Anatole Tresch

Renewal of Legacy Frameworks

An Experience Report

GeeCon 2014

May 2014

Page 2: Legacy Renewal of Central Framework in the Enterprise

2Renewal of Central Frameworks – An Experience Report May 2014

Bio

Anatole Tresch Consultant, Coach Credit Suisse Core Framework Engineer,

Technical Architect Specification Lead JSR 354 Driving Java EE Config

Twitter/Google+: @atsticks [email protected] [email protected] Java Config Discussion https://groups.google.com/forum/#!forum/java-config Java Config Blog: http://javaeeconfig.blogspot.ch Zurich Java Community (

https://plus.google.com/u/0/communities/106363890913137321158) Zurich Hackergarten (

https://plus.google.com/u/0/103936743237262644768/posts)

Page 3: Legacy Renewal of Central Framework in the Enterprise

3Renewal of Central Frameworks – An Experience Report May 2014

Credit Suisse

Global Bank with Headquarter in Zurich, Clients in Private Banking, Investment Banking and Asset Management.

Shares as Credit Suisse Group AG (CSGN) in Switzerland(SIX) and as American Depositary Shares (CS) in New York (NYSE).

47,400 Employees. Ratings: Moody’s A2, Standard & Poor’s A, Fitch

Ratings A.

Page 4: Legacy Renewal of Central Framework in the Enterprise

4Renewal of Central Frameworks – An Experience Report May 2014

Renewal of Central FrameworksAgenda

Where we started

Objectives and Constraints

Challenges

CS Java Application Platform

Implementation

Summary

Page 5: Legacy Renewal of Central Framework in the Enterprise

5Renewal of Central Frameworks – An Experience Report May 2014

Where we started

Page 6: Legacy Renewal of Central Framework in the Enterprise

6Renewal of Central Frameworks – An Experience Report May 2014

The Credit Suisse ITFrom a Bird’s View

On-, Offshore ca. 20’000+ Employees in IT

Multiple global distributed Operation Centers

Protocol-Mix: Corba, WS, Restful, RMI, …

Technology-Mix: Java, DotNet, PL/1, Oracle, Sybase,

MS SQL Server, DB2, IMS, Smalltalk, Python,

MS Access

In-House and COTS Solutions

Total > 1000 applications

Page 7: Legacy Renewal of Central Framework in the Enterprise

7Renewal of Central Frameworks – An Experience Report May 2014

Java Core FrameworksDeployment

Global Deployment

Part of the Java Application Platform

Infrastructure (JAP)

2-3 Major Releases active in parallel

Delivery: 3 Jars + Scripts

Developer-Desktop: Windows

Production: Solaris/Linux

Page 8: Legacy Renewal of Central Framework in the Enterprise

8Renewal of Central Frameworks – An Experience Report May 2014

Java Core Frameworks

Java Core FrameworksPositioning within the Software and Hardware Stack

Infrastructure-Code!

Page 9: Legacy Renewal of Central Framework in the Enterprise

9Renewal of Central Frameworks – An Experience Report May 2014

1.5 Mio LOC

2 Mio LOC

1 Mio LOC

500k LOC

Java in Credit SuisseA typical Application-Stack

Clients

Entry

Host

Web

Business

CSIB (synchron)MQ Series

(asynchron)

WebWeb

Business

Employees

Web

BusinessBusiness

External Interfaces

COTS

BatchBatch

TA Monitoring

Web

EntryEntry

Web WebWeb

BusinessBusiness

Batch

Web

BusinessBusiness

Business

Core FrameworksColors = versions

Page 10: Legacy Renewal of Central Framework in the Enterprise

10Renewal of Central Frameworks – An Experience Report May 2014

Java Core FrameworksThe Java Core Frameworks’s Functionality

Go for the money - JSR 354 - http://java.net/projects/javamoney 23th October 2013

Context Management (Tracing, Accounting)

Exception Propagation (incl. Trace-Context)

High Performance Logging, Audit Logging

Platform-Abstraction Layer

Configuration Management (Deployment, Application)

JMX Registration und Naming Services

i18n

Common Utilities

Page 11: Legacy Renewal of Central Framework in the Enterprise

11Renewal of Central Frameworks – An Experience Report May 2014

Java Core FrameworksFunctionality of the Java Core Frameworks – a Simulation

Entry

Web

Business Business2 HostExternal

Service Bus

ContextContext

ExceptionContext

Error

Audit

Audit

Audit

Audit

Audit

Log

Log

Log

Log

LogLog

Log

MessageBus

Log

Audit

Page 12: Legacy Renewal of Central Framework in the Enterprise

12Renewal of Central Frameworks – An Experience Report May 2014

Java Core FrameworksFrom Daily Business

Increasing Support Efforts

Non solvable Problems

Complicated, invasive APIs

Missing or complicated SPIs

Implementation- and Runtime Dependencies

Lack of Flexibility and Extendability

Slow, uncomprehensive Code

Missing, outdated or uncomprehensive documentation

Page 13: Legacy Renewal of Central Framework in the Enterprise

13Renewal of Central Frameworks – An Experience Report May 2014

Quality IssuesAPI?

public interface Manageable {

/** * Invokes different methods in all classes that implement this * interface. What method actually is performed is determined by the * argument <B>cmd</B>. The Stringarray options contains the * arguments for invoking the method. * @param command * The method that should be invoked. * @param options * The command line arguments for the command. * @throws Throwable * If an error occurs. * @return The return value depends on the method that is invoked. */ public Serializable invoke(String command, String[] options) throws Throwable;}

Page 14: Legacy Renewal of Central Framework in the Enterprise

14Renewal of Central Frameworks – An Experience Report May 2014

Quality IssuesSPI?

/** * Manages the storage of a {@link CoreContextHolder} object. Extending this * class, allows to support different storage behaviours. A CoreContextHolder * Store is used in {@link CoreContext}. Hint: Abstract class * is used to be visible package local only. */abstract class CoreContextHolderStore {

/** Returns the previous stored CoreContextHolder. */ abstract CoreContextHolder getCoreContextHolder(); /** Stores a CoreContextHolder. */ abstract void setCoreContextHolder(CoreContextHolder holder);

/** Factory to get CoreContextHolderStore instance. */ final static class Factory { enum Type { DEFAULT, SINGLETON, THREADLOCAL, WORKCONTEXT }; private final static Factory SINGLETON = new Factory();

/** type of factory. */ private Type instanceType = Type.DEFAULT; /** store created last time */ private CoreContextHolderStore storeCreated = null; static Factory getSingleton() { return SINGLETON; } …

Page 15: Legacy Renewal of Central Framework in the Enterprise

15Renewal of Central Frameworks – An Experience Report May 2014

Quality IssuesComprehensivness/Complexity

public void loadDefaultFromRescource(String[] resources) throws ConfigException{ String environment = System.getProperty(PROPERTY_ENVIRONMENT); environment = ENVIRONMENT_MAP.get(environment); String rescourcePath = null; for (int i = 0; i < resources.length; i++) { rescourcePath = CONFIG_IN_JAR_FOLDERS_START + environment + CONFIG_IN_JAR_FOLDERS_END; try { loadDefaultFromRescource(rescourcePath + resources[i]); } catch (ConfigException e) { if("BASE0130".equals(e.getExceptionContext().getMessageID())) { rescourcePath = CONFIG_IN_JAR_FOLDERS_START + FOLDER_ENV_GLOBAL + CONFIG_IN_JAR_FOLDERS_END; loadDefaultFromRescource(rescourcePath + resources[i]); } } } }

Page 16: Legacy Renewal of Central Framework in the Enterprise

16Renewal of Central Frameworks – An Experience Report May 2014

Quality IssuesOther Metrics

17’000 LOC / 8721 Statements

204 Typen, 1400 Methoden

23 Packet Cycles !

Strong Coupling

Big Artifacts (> 1500 LOC)

Only a Few Interfaces

No Annotations

Missing Information Hiding

Page 17: Legacy Renewal of Central Framework in the Enterprise

17Renewal of Central Frameworks – An Experience Report May 2014

Where we startedConclusion

Signific. Issues

Widely Used

RISK!

Page 18: Legacy Renewal of Central Framework in the Enterprise

18Renewal of Central Frameworks – An Experience Report May 2014

Objectives and Constraints

Page 19: Legacy Renewal of Central Framework in the Enterprise

19Renewal of Central Frameworks – An Experience Report May 2014

Objectives and ConstraintsTechnical Objectives

Improved Stability, Maintainability and Extendibility

Improved Performance and Scalability

Improved Usability

Convention over Configuration

Easy Testing (independent tests!)

Reduction of API Footprint (decoupling)

Technical Innovation (IoC)

Maximal Backward Compatibility, smooth Migration Path

Page 20: Legacy Renewal of Central Framework in the Enterprise

20Renewal of Central Frameworks – An Experience Report May 2014

Objectives and ConstraintsCompatibility

Backward Compatibility:

Context Propagation

Serialization (Context, Exceptions)

Build and behavioral Compatibility (API)

Reduced Compatibility Requirements on

Implementation Artifacts

Forward Compatibility:

Context Propagation

Serialization (Context, Exceptions)

Page 21: Legacy Renewal of Central Framework in the Enterprise

21Renewal of Central Frameworks – An Experience Report May 2014

Objectives and ConstraintsOrganizational Objectives

Reduce Support Efforts

Simplify Framework Development

Continuous Build

(Semi-) Automatic Deployment

Building up Know How

Page 22: Legacy Renewal of Central Framework in the Enterprise

22Renewal of Central Frameworks – An Experience Report May 2014

Objectives and ConstraintsChallenges

Quality Culture

Non-Standard Tool-Chain

Stakeholder Management

Time & Budget

Skills

Page 23: Legacy Renewal of Central Framework in the Enterprise

23Renewal of Central Frameworks – An Experience Report May 2014

CS Java Application PlatformThe Environment

Page 24: Legacy Renewal of Central Framework in the Enterprise

24Renewal of Central Frameworks – An Experience Report May 2014

Java Application Platform JAPIdea and Motivation

Applikation LogicGUI, Business Logic, DB Schemas, Configuration, etc.Infrastructure Design/ConfigurationHW, OS, Middleware, NetworkSystems ManagementOperating ManualsDevelopment Tools and ProcessesSecurity Services and ProcessesIntegration Services and Processes

Applikation Platform (AP)Optimized for similar applications,Based on Hosting PlatformsHosting PlatformsProvide Common Services• Computation CHP (Hardware, OS)• Persistence DHP (Databases)

Page 25: Legacy Renewal of Central Framework in the Enterprise

25Renewal of Central Frameworks – An Experience Report May 2014

JAP Lifecycle ManagementWhy Lifecycle Management?

• Applications and Components without managed Lifecycle

• Uncoordinated technical Upgrades

• Incompatibilities

• Managed Lifecycle• Coordinated and tested

technical Upgrades (HW+SW!)

• Constant Decommissioning of old Platform Releases

• New Releases wont impact existing applications

Page 26: Legacy Renewal of Central Framework in the Enterprise

26Renewal of Central Frameworks – An Experience Report May 2014

JAP Lifecycle ManagementRelease Planning

Page 27: Legacy Renewal of Central Framework in the Enterprise

27Renewal of Central Frameworks – An Experience Report May 2014

Implementation

Page 28: Legacy Renewal of Central Framework in the Enterprise

28Renewal of Central Frameworks – An Experience Report May 2014

ImplementationRelease Planning

Major Releases synchronous with JAP Platform

(periodically all 2-3 Years)

Patch Releases 2-3/Year

Emergency Releases as necessary

1 Major Framework Release =

Proposals, Requirements, Feature Selection beforehand

6 months Implementation and Component Tests

6 months Integration Testing and Documentation

Page 29: Legacy Renewal of Central Framework in the Enterprise

29Renewal of Central Frameworks – An Experience Report May 2014

ImplementationSpecification/Design

High Level Design (Make or “Buy”)

Existing Functionality in Java EE 5/6, Weblogic?

Third Party / OSS Libraries? Functional Gap?

Low Level Design Minimize APIs, go for Effective Java Immutable Value Objects Thread-Save with Low Latency Multi-Tenancy, Multi-Language, Multi-Timezone etc. Decide on Adaption of existing APIs vs. Recreation and

Coexistence Consider Operational Aspects

Page 30: Legacy Renewal of Central Framework in the Enterprise

30Renewal of Central Frameworks – An Experience Report May 2014

ImplementationTeam and Organization

Agile Process (no Offshoring)

2 Full-Time Programmers

Pair Programming as Needed

Hire the Best you get!

Page 31: Legacy Renewal of Central Framework in the Enterprise

31Renewal of Central Frameworks – An Experience Report May 2014

ImplementationFurther Details

Extend and Improve Existing Tests

Improve/write Component Tests instead of Smoke Tests

Create Compatibility and Interop Tests

Ensure Independent Test Execution (Test Isolation)

Ensure Integration Tests (across multiple releases!)

Integrate early!

API

Deprecate old APIs (for at least(!) one Release)

Check Backward Compatibility with Sonar/clirr

continously

Page 32: Legacy Renewal of Central Framework in the Enterprise

32Renewal of Central Frameworks – An Experience Report May 2014

ImplementationQuality Management

Static Code Analysis: Continuous and integrated, on each code change,

that compiled Based on Sonar, with customized Profile and Custom

Rules Coverage Analysis of Component Tests Basic Integrationstests Regular Check of Metrics, Alarms!

Peer-Reviews of all Code Changes Integration Tests with big Pilots

Page 33: Legacy Renewal of Central Framework in the Enterprise

33Renewal of Central Frameworks – An Experience Report May 2014

ImplementationFramework Release Cycles

Similar to Platform Releases Playground 1 (first drop) Playground 2 (functional) Alpha (API stable) Beta (only patches) Release Candidate Final Release Patch Releases (regular updated) Emergency Releases (as needed)

Page 34: Legacy Renewal of Central Framework in the Enterprise

34Renewal of Central Frameworks – An Experience Report May 2014

ImplementationFist Run 2010 - 5.0.0 -> 6.0.0

Partial API Renewal and API Reduction

Defined SPIs

Implementation Modularization and Encapsulation

(Spring/Lenz)

Focus on

Critical Functionalities

Stabilize Existing Code Base

Focus on Stability, reduce Complexity

3 Jars + Scripts-> Only Partial Renewal

-> significant Compatibility Breaks

-> Massive Performance Gains

Page 35: Legacy Renewal of Central Framework in the Enterprise

35Renewal of Central Frameworks – An Experience Report May 2014

ImplementationSecond Run 2012 - 6.0.0 -> 7.0.0

HW/OS Change from Solaris to Linux Several small Improvements Fixing of Known Issues (sometimes with behavioral

changes!) Low Latency Requirements Introduction of a Runtime Platform Abstraction Layer Replacement of Spring with a leaner Container Introduction of Continuous Build based on Maven

7 Jars + Scripts QC with Sonar -> Renewal still ongoing

-> only a few compatibility breaks

-> New, efficient tool chain

Page 36: Legacy Renewal of Central Framework in the Enterprise

36Renewal of Central Frameworks – An Experience Report May 2014

ImplementationThird Run 2013/2014 - v7.0.0 -> 8.0.0 (today)

Introduction of Java EE 6 (formerly EE 5)

Complex Integration of Low Level Features / CDI

New Annotation based API

Long Lasting Deprecations (New IOC Paradigma)

Renewal of Further Areas Untouched so far

Full CDI-Support -> Renewal Finished

-> only few Compatibility Issues

-> reduced API Footprint

(Annotations)

-> modern API (CDI)

Page 37: Legacy Renewal of Central Framework in the Enterprise

37Renewal of Central Frameworks – An Experience Report May 2014

Conclusion

5.0 6.0 7.0 8.0

……..?

Page 38: Legacy Renewal of Central Framework in the Enterprise

38Renewal of Central Frameworks – An Experience Report May 2014

ConclusionKey Factors

Functional and Effective Tooling

Continuous Build with Integrated Quality Measurement

Agil and Effective Collaboration Culture

Focus on task: minimize Maintenance for former Releases

Ensure enough Budget and Time

Define a realistic Scope

Managed Environment (Lifecycle and Platform

Management)

Use complex Test-Pilots early!

Page 39: Legacy Renewal of Central Framework in the Enterprise

39Renewal of Central Frameworks – An Experience Report May 2014

ConclusionDid we met our Objectives?

Significant Reduction of Support Efforts

Establishment of Maintainability and

Extendibility

Improved Runtime Behavior (Performance,

Memory)

Reduction (Optimization) of API Footprint

Simplify Testing

Enable Technical Progress

Improved Quality

Backward Compatibility, if possible

Yes, but moreartifacts & LOC!

-50%

Yes.

100 x faster

Yes.

Yes EE6/7supported

-50%

mostly

SUCCESS!

Page 40: Legacy Renewal of Central Framework in the Enterprise

40Renewal of Central Frameworks – An Experience Report May 2014

ConclusionActual Metrics

Page 41: Legacy Renewal of Central Framework in the Enterprise

41Renewal of Central Frameworks – An Experience Report May 2014

ConclusionAPI Evolution

Configuration appCfg = ConfigHelper.getConfigManager() .getApplicationConfig();Map<String,String> config = null;if(appCfg.containsArea("a.b.c")){ config = appCfg.getArea("a.b.c", false);}

@Configured@ConfigRoot(value="a.b.c", recursive=false)@Optionalprivate Map<String,String> config;

OLD:

NEW:

Page 42: Legacy Renewal of Central Framework in the Enterprise

42Renewal of Central Frameworks – An Experience Report May 2014

ConclusionAPI Evolution 2

private static final TraceLogger tl = TraceLoggerHelper.getTracLogger( getClass(), TraceType.SERVICE);

public void bookSettlement(Settlement s){ tl.entering(getClass(), "bookSettlement", s); // perform… tl.exiting(getClass(), "bookSettlement", s);}

OLD:

NEW:@TraceLogged(TraceType.SERVICE)public void bookSettlement(Settlement s){ // perform…}

Page 43: Legacy Renewal of Central Framework in the Enterprise

43Renewal of Central Frameworks – An Experience Report May 2014

Q & A

???

Page 44: Legacy Renewal of Central Framework in the Enterprise

44Renewal of Central Frameworks – An Experience Report May 2014

The End

THANK YOU!