modularity and api design

17
1 Modularity and API Design January 2015 Johannes Kepler University Linz, Austria http://www.jku.at Jaroslav Tulach (@JaroslavTulach) Lukas Stadler Thomas Wuerthinger (@thomaswue)

Upload: others

Post on 07-Apr-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modularity and API Design

1

Modularity andAPI Design

January 2015Johannes Kepler University Linz, Austriahttp://www.jku.at

Jaroslav Tulach (@JaroslavTulach)

Lukas Stadler

Thomas Wuerthinger (@thomaswue)

Page 2: Modularity and API Design

2

Goals

● Why is modularity essential?

● How to scale the development of a large software system?

● Why are APIs like stars?

● How to design an API that is extensible without breaking backwards

compatibility?

● What modularity and API design concepts are relevant in languages other

than Java?

● What are modularity concepts in NetBeans?

● Project

Page 3: Modularity and API Design

3

Don't reinvent the wheel!

Page 4: Modularity and API Design

4

Page 5: Modularity and API Design

5

Learning Curve

Results

Effort

Reuse

Reinvent

Page 6: Modularity and API Design

6

Object Oriented Spaghetti Code

≈ O(n2) dependencies

Page 7: Modularity and API Design

7

Module System

≈ O(n) dependencies

Page 8: Modularity and API Design

8

Tracking impacts

Page 9: Modularity and API Design

9

Information Hiding

Public API

Module B

Implementation

Module A

Page 10: Modularity and API Design

10

Limits are your friend!

Restrict dependencies

Small public API

Page 11: Modularity and API Design

11

Clean Structure

Results

Effort

Quick & Dirty

Clean & Modular

Page 12: Modularity and API Design

12

Distributed Development

Public API

Implementation

Module User Module Developer

sees publishes

creates

Page 13: Modularity and API Design

13

Mechanisms in Java

Access modifiers only at class level -

Custom class loaders!

JDK9: New modularized JDK

Page 14: Modularity and API Design

14

GOTO vs IF, WHILE, …

=

unrestricted OOP vs modular programming

?

Page 15: Modularity and API Design

15

Page 16: Modularity and API Design

16

Application

Architecture Eclipse/NetBeans

Platform

Swing / JDK

Java VM

IDE

Page 17: Modularity and API Design

17

Detailed Architecture

Swing / JDK

Java VM

Application

Platform

IDE

● Standalone: Deployment including required platform / IDE modules

● Plugin: Deployment only with user-defined modules