sap inside track frankfurt 2015 martin steinberg and damir majer

29
APIs (not only) in SAP environments Damir Majer @majcon SAP Inside Track Frankfurt 2015 Martin Steinberg @SbgMartin

Upload: damir-majer

Post on 20-Jul-2015

299 views

Category:

Software


6 download

TRANSCRIPT

Page 1: Sap inside track frankfurt 2015   martin steinberg and damir majer

APIs (not only) in SAP environments

Damir Majer @majcon

SAP Inside Track Frankfurt 2015

Martin Steinberg @SbgMartin

Page 2: Sap inside track frankfurt 2015   martin steinberg and damir majer

API?

more  and  more  companies  expose  their  application‘s  functionality  to  the  outside  world

Copyright:  http://www.webplanex.com/wp-­‐content/uploads/2014/03/API-­‐Development.png

Page 3: Sap inside track frankfurt 2015   martin steinberg and damir majer

Why is it important for me?

‣API  can  be  stated  to  be  a  foundation  for  building  applications  ‣ Innovative  applications  based  on  existing  implementations/functionality  ‣Applications  need  functionality  from  different  (cloud)  services/systems  ‣API  „customers“  are  developers  ‣ can  be  composed  creatively

Page 4: Sap inside track frankfurt 2015   martin steinberg and damir majer

An example

‣more  and  more  applications  use  this  exposed  functionality

mobile  application

 Any  SaaS  API Amazon  SaaS  API SAP  Backend  API

<<uses>>

Apache  API

Page 5: Sap inside track frankfurt 2015   martin steinberg and damir majer

Why is it important for me?

‣API‘s  are  usually  available  over  internet  (public)  ‣ customers/users  have  to  signup  for  usage  („apikey“)  ‣ „private  API‘s“  for  internal  use  (e.g.  SAP  backend  system  or  SAP  HANA  system)  within  company‘s  environment

Page 6: Sap inside track frankfurt 2015   martin steinberg and damir majer

Versioning

Security

Scalable

Documentation

Simple

Monetizable

Analyzable7

Page 7: Sap inside track frankfurt 2015   martin steinberg and damir majer

API foundation

API  foundation  layer

Business  Logic

Standardization  of  ‣ user  Management  ‣ authorization  checks  ‣ logging  ‣ use  of  harmonized  patterns  ‣ discovery  ‣ documentation

Shared  Memory

Page 8: Sap inside track frankfurt 2015   martin steinberg and damir majer

„Private API“

SAP  Business  Suite  System

Business  Logic

API  components API  components API  components„private  API“

Service  Integration  Layer

dependency

Custom  Applications

<<uses>>

HTML5 Apps SAPUI5

<<embedded>>

Page 9: Sap inside track frankfurt 2015   martin steinberg and damir majer

Solutions in ABAP

Page 10: Sap inside track frankfurt 2015   martin steinberg and damir majer

‣ Systems  should  expose  behavior  with  interfaces  ‣ Interfaces  are  meant  and  not  Classes…  ‣ Interfaces  only  show  the  Specification  and  allow  clear  isolation  from  the  implementation  part

Program against an Interface and not against an Implementation

Page 11: Sap inside track frankfurt 2015   martin steinberg and damir majer

class lcl_very_important definition. public section.

interfaces: lif_smart_interface. “…

endclass.

class lcl_very_important implementation. “… method lif_smart_interface~applause. “ really cool and fancy implementations“ it´s your action ;-) endmethod.

endclass.

interface lif_smart_interface. public section.

methods: applause importing iv_loudness type i.

endinterface.

client lif_smart_interface lcl_very_important

Page 12: Sap inside track frankfurt 2015   martin steinberg and damir majer

Design Pattern

Page 13: Sap inside track frankfurt 2015   martin steinberg and damir majer
Page 14: Sap inside track frankfurt 2015   martin steinberg and damir majer

‣ complex Solutions are defined by a Name ‣Developer has an unique vocabulary

creational structural behavioral

Pattern categories

Page 15: Sap inside track frankfurt 2015   martin steinberg and damir majer

Facade Pattern

FACADE

Page 16: Sap inside track frankfurt 2015   martin steinberg and damir majer

API as a facade

Business  LogicAPI  components

Business  LogicAPI  components

Business  LogicAPI  components

Idealistic  approach:  harmonized  object  model  homogenous  interface  design

delivered  or  custom

Business  Logic

Business  Logic

clear  and  simple  to  use

Page 17: Sap inside track frankfurt 2015   martin steinberg and damir majer

API components – from a quality perspective

Let‘s  differentiate  between  3  different  quality  levels:  • Tools  

• for  time-­‐limited  usage,  like  data  migration  report  • Potential  library  components  

• any  implementation  which  is  not  library,  yet  • Library  components  

• automated  testing  necessary  from  the  beginning  • stable  interface  • Versioning  • Documentation  

• API  components  are  „library  components“  

• ABAP  Unit  • Documentation  (ABAP  Doc  +  DMS)  

Page 18: Sap inside track frankfurt 2015   martin steinberg and damir majer

Testable Code

Page 19: Sap inside track frankfurt 2015   martin steinberg and damir majer

25% - 50% of Development costs are used for Testing

Software should be simple tested

Page 20: Sap inside track frankfurt 2015   martin steinberg and damir majer

isolated testedtoo much dependencies

Page 21: Sap inside track frankfurt 2015   martin steinberg and damir majer
Page 22: Sap inside track frankfurt 2015   martin steinberg and damir majer

Dependency Injection

‣concept idea by Martin Fowler ‣based on Single Responsibility Principle (SRP)

‣a class uses available functionality of another class only by implementing against the interface ‣allows different implementation approaches

http://en.wikipedia.org/wiki/Dependency_injection  http://en.wikipedia.org/wiki/Dependency_inversion_principle    http://en.wikipedia.org/wiki/SOLID_%28object-­‐oriented_design%29

Page 23: Sap inside track frankfurt 2015   martin steinberg and damir majer

Dependency(Injec+on(

Page 24: Sap inside track frankfurt 2015   martin steinberg and damir majer

Isola&on(by(mocking(

0  Mocking(is(a(principle(coming(from(test(driven(development(

0  use(dependency(injec&on(for(mocking(purposes(

0  use(it(for(contract0first(approach(

Page 25: Sap inside track frankfurt 2015   martin steinberg and damir majer

Public API

SAP  Business  Suite  System

Business  Logic

API  components API  components API  components„private  API“

Service  Integration  Layere.g.  AS  ABAP    frontend  server(s)  EAI

API  components„public  API“ API  components API  componentsAPI  Mgmt.  

HTML5 Apps Customers …

Page 26: Sap inside track frankfurt 2015   martin steinberg and damir majer

Service  Integration  Layer

API  components

API  Mgmt.Service  Integration  Layer

API  components

API  Mgmt.

Service  Integration  Layer

API  components

API  Mgmt.Service  Integration  Layer

API  components

API  Mgmt.

Gateway  as  a  Service

API  components

API  Mgmt.

Extension  Apps

Public  API  provider

HybrisGoogle,  …

Did  you  recognize  the  yaas.io  announcement?

Page 27: Sap inside track frankfurt 2015   martin steinberg and damir majer

is to be flexible

Page 28: Sap inside track frankfurt 2015   martin steinberg and damir majer

Martin Steinberg

about.me/martin.steinberg twitter: @SbgMartin

Damir Majer

www.majcon.de twitter: @majcon

Page 29: Sap inside track frankfurt 2015   martin steinberg and damir majer

Thank you for your attention!