Managing Modular Software for your NuGet, C++ and Java Development - - PowerPoint PPT Presentation

managing modular software
SMART_READER_LITE
LIVE PREVIEW

Managing Modular Software for your NuGet, C++ and Java Development - - PowerPoint PPT Presentation

Managing Modular Software for your NuGet, C++ and Java Development Agenda Modular software why? Building modular software in Java in C++ in .NET Whos talking? @jbaruch 3 WTF IS MODULE? Module Modular


slide-1
SLIDE 1

Managing Modular Software

for your NuGet, C++ and Java Development

slide-2
SLIDE 2

Agenda

  • Modular software – why?
  • Building modular software…
  • … in Java
  • … in C++
  • … in .NET
slide-3
SLIDE 3

Who’s talking?

3

@jbaruch

slide-4
SLIDE 4

WTF IS MODULE?

slide-5
SLIDE 5

Module

Modular programming (also called "top- down design" and "stepwise refinement") is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.

slide-6
SLIDE 6

TL;DR

slide-7
SLIDE 7

Module

slide-8
SLIDE 8

Module Formula

Data + Metadata = Module

slide-9
SLIDE 9

Unit of code

slide-10
SLIDE 10

Encapsulated

slide-11
SLIDE 11

Encapsulated

slide-12
SLIDE 12

Discrete

slide-13
SLIDE 13

Discrete

slide-14
SLIDE 14

Discrete

slide-15
SLIDE 15

Reusable

slide-16
SLIDE 16

Exposed via APIs

slide-17
SLIDE 17

Packages

slide-18
SLIDE 18
slide-19
SLIDE 19

Modules or Packages?

Technology ¡ Package ¡ Module ¡

slide-20
SLIDE 20

Modules or Packages?

Technology ¡ Package ¡ Module ¡ Java ¡ package ¡keyword ¡seman2cs ¡ *.jar ¡files, ¡OSGi ¡bundles ¡

slide-21
SLIDE 21

Modules or Packages?

Technology ¡ Package ¡ Module ¡ Java ¡ package ¡keyword ¡seman2cs ¡ *.jar ¡files, ¡OSGi ¡bundles ¡ C++ ¡ namespace ¡keyword ¡seman2cs ¡ *.dll ¡files, ¡*.so ¡files ¡

slide-22
SLIDE 22

Modules or Packages?

Technology ¡ Package ¡ Module ¡ Java ¡ package ¡keyword ¡seman2cs ¡ *.jar ¡files, ¡OSGi ¡bundles ¡ C++ ¡ namespace ¡keyword ¡seman2cs ¡ *.dll ¡files, ¡*.so ¡files ¡ C# ¡ namespace ¡keyword ¡seman2cs ¡ *.dll ¡files, ¡NuGet ¡packages ¡

slide-23
SLIDE 23

Modular Software – why?

slide-24
SLIDE 24

Discrete Units Are Smaller

slide-25
SLIDE 25

Modular Security Control

slide-26
SLIDE 26

Multi-Team Agility

slide-27
SLIDE 27

Code Sharing

slide-28
SLIDE 28

Forcing API

slide-29
SLIDE 29

Module ð Dependency

slide-30
SLIDE 30

HOW STUFF PLAYS WITH MODULES

slide-31
SLIDE 31

Build Tools and Dependencies

slide-32
SLIDE 32

Recipe

  • 1. Take sources
slide-33
SLIDE 33

Recipe

  • 1. Take sources – OK
slide-34
SLIDE 34

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies
slide-35
SLIDE 35

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies – where from?
slide-36
SLIDE 36

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies – where from?
  • 3. Build binaries
slide-37
SLIDE 37

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies – where from?
  • 3. Build binaries – OK
slide-38
SLIDE 38

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies – where from?
  • 3. Build binaries – OK
  • 4. …
slide-39
SLIDE 39

Recipe

  • 1. Take sources – OK
  • 2. Bring dependencies – where from?
  • 3. Build binaries – OK
  • 4. … - now what?
slide-40
SLIDE 40

CI Servers and Modules

slide-41
SLIDE 41

CI servers run build tools.

slide-42
SLIDE 42

CI servers run build tools.

slide-43
SLIDE 43

We can do better!

slide-44
SLIDE 44

Cascading Builds

slide-45
SLIDE 45

Per module results

slide-46
SLIDE 46

Wait, while on the CI Servers…

slide-47
SLIDE 47

BINARY REPOSITORY AND…

slide-48
SLIDE 48

What is Binary Repository

slide-49
SLIDE 49

Said who?

slide-50
SLIDE 50

Binary Repository Experts

slide-51
SLIDE 51

Binary Repository as Modules Source

slide-52
SLIDE 52

Binary Repository as Modules Source

slide-53
SLIDE 53

Binary Repository as Modules Source

slide-54
SLIDE 54

Binary Repository as Deployment Target

slide-55
SLIDE 55

Binary Repository as Deployment Target

slide-56
SLIDE 56

Wait a Minute, What’s Wrong With My Source Control System?!

slide-57
SLIDE 57
slide-58
SLIDE 58

Sources vs. Binaries

Sources ¡ Binaries ¡

slide-59
SLIDE 59

Sources vs. Binaries

Sources ¡ Binaries ¡ Text ¡ Blob ¡

slide-60
SLIDE 60

Sources vs. Binaries

Sources ¡ Binaries ¡ Text ¡ Blob ¡ Diffable ¡ Not ¡diffable ¡

slide-61
SLIDE 61

Sources vs. Binaries

Sources ¡ Binaries ¡ Text ¡ Blob ¡ Diffable ¡ Not ¡diffable ¡ Versioned ¡by ¡ content ¡ Versioned ¡by ¡ name ¡

slide-62
SLIDE 62

Sources vs. Binaries

Sources ¡ Binaries ¡ Text ¡ Blob ¡ Diffable ¡ Not ¡diffable ¡ Versioned ¡by ¡ content ¡ Versioned ¡by ¡ name ¡ Stored ¡by ¡

  • verride ¡

Should ¡never ¡

  • verride ¡
slide-63
SLIDE 63

Versioning By Content

¡ Text ¡ MyPoem.txt ¡ (rev. ¡01) ¡

slide-64
SLIDE 64

Versioning By Content

Text ¡ More ¡ Text ¡ MyPoem.txt ¡ (rev. ¡02) ¡

slide-65
SLIDE 65

Versioning By Content

Text ¡ More ¡ Text ¡ More ¡ Text ¡ MyPoem.txt ¡ (rev. ¡03) ¡

slide-66
SLIDE 66

Versioning By Content

Text ¡ More ¡ Text ¡ More ¡ MyPoem.txt ¡ (HEAD) ¡

slide-67
SLIDE 67

Mismatch

Text ¡ More ¡ Text ¡ More ¡ Text ¡ MyPoem.txt ¡ 0100110 1010011 0110101 ¡ 0100110 1001101 1011010 ¡ 1010011 1010011 0110101 ¡ MyBook-­‑1.0.zip ¡ MyBook-­‑1.1.zip ¡ MyBook-­‑2.0.zip ¡

slide-68
SLIDE 68
slide-69
SLIDE 69
slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72

Git is a Distributed System

slide-73
SLIDE 73

R U SURE U WANT 2 CLONE IT ALL?

slide-74
SLIDE 74

OK Then, But What’s Wrong With My File Server?!

slide-75
SLIDE 75

It’s Fine if it knows how to:

slide-76
SLIDE 76

It’s Fine if it knows how to:

Optimize storage size

slide-77
SLIDE 77

It’s Fine if it knows how to:

Optimize storage size

slide-78
SLIDE 78

It’s Fine if it knows how to:

Optimize storage size Expose REST API

slide-79
SLIDE 79

It’s Fine if it knows how to:

Optimize storage size Enforce Module Security Expose REST API

slide-80
SLIDE 80

It’s Fine if it knows how to:

M a n a g e a r t i f a c t l i f e c y c l e Optimize storage size Enforce Module Security Expose REST API

slide-81
SLIDE 81

It’s Fine if it knows how to:

M a n a g e a r t i f a c t l i f e c y c l e Optimize storage size Enforce Module Security Expose REST API

slide-82
SLIDE 82

It’s Fine if it knows how to:

M a n a g e a r t i f a c t l i f e c y c l e Optimize storage size Enforce Module Security Expose REST API Search by name, context and content

slide-83
SLIDE 83

BTW, How Many Years It Took?

slide-84
SLIDE 84

Binary Repository and CI/CD

slide-85
SLIDE 85

CI Server is the Single Source of Truth

slide-86
SLIDE 86

Binary Repository is The Single Target of Truth

slide-87
SLIDE 87

Save the Truth!

slide-88
SLIDE 88

Make Strange Binary Love

slide-89
SLIDE 89

Standard of Truth

slide-90
SLIDE 90

How Everything Fits Together

slide-91
SLIDE 91

How Everything Fits Together

slide-92
SLIDE 92

How Everything Fits Together

slide-93
SLIDE 93

How Everything Fits Together

slide-94
SLIDE 94

How Everything Fits Together

slide-95
SLIDE 95

How Everything Fits Together

slide-96
SLIDE 96

How Everything Fits Together

slide-97
SLIDE 97

Perfect…

slide-98
SLIDE 98

You Liked it, didn’t you?

slide-99
SLIDE 99

Things to Consider

slide-100
SLIDE 100

Lock-in?

slide-101
SLIDE 101

Technology Specific?

slide-102
SLIDE 102

Features to Look For

ü Not only Maven ü Not only Java ü Broad CI tools matrix

ü Build tools ü CI Servers

ü Extensive REST support ü Easy to extend

M

  • s

t b

  • r

i n g s l i d e s

  • f

a r …

slide-103
SLIDE 103

MODULES IN… JAVA

slide-104
SLIDE 104

Java package

slide-105
SLIDE 105

Fragmentation

slide-106
SLIDE 106

The options are:

  • OSGi
  • Jigsaw
  • Build systems managed

– Maven, Gradle, Ivy

B u l l e t s ? R e a l l y ?

slide-107
SLIDE 107
slide-108
SLIDE 108
slide-109
SLIDE 109
slide-110
SLIDE 110
slide-111
SLIDE 111
slide-112
SLIDE 112
slide-113
SLIDE 113
slide-114
SLIDE 114

Project Jigsaw

First promise: Java 7 (2008) Current promise: Java 9 (2015)

slide-115
SLIDE 115

Project Jigsaw

First promise: Java 7 (2008) Current promise: Java 9 (2015)

slide-116
SLIDE 116

Back to plain old

slide-117
SLIDE 117

Modular Build in Java

slide-118
SLIDE 118

Modular Build in Java

slide-119
SLIDE 119

Modular Build in Java

slide-120
SLIDE 120

Modular Build in Java

slide-121
SLIDE 121

Modular Build in Java

slide-122
SLIDE 122

Modular Build in Java

slide-123
SLIDE 123

Modular Build in Java

slide-124
SLIDE 124

Modular Build in Java

slide-125
SLIDE 125

Modular Build in Java

slide-126
SLIDE 126

Modular Build in Java

slide-127
SLIDE 127

MODULES IN… C++

slide-128
SLIDE 128
slide-129
SLIDE 129
slide-130
SLIDE 130
slide-131
SLIDE 131
slide-132
SLIDE 132

Module Binaries Library ¡ OS ¡ File ¡type ¡ Sta2c ¡ Win ¡ *.lib ¡ *nix ¡ *.a ¡ Dynamic ¡ Win ¡ *.dll ¡ *nix ¡ *.so ¡

slide-133
SLIDE 133

Managing Dependencies in C++

slide-134
SLIDE 134

Managing Dependencies in C++

slide-135
SLIDE 135

Make?

slide-136
SLIDE 136

Make?

slide-137
SLIDE 137

Make?

slide-138
SLIDE 138

CMake?

slide-139
SLIDE 139

Java-Like (and Java) tools?

slide-140
SLIDE 140

Groovy tool!

slide-141
SLIDE 141

Modular Build in C++

slide-142
SLIDE 142

Modular Build in C++

slide-143
SLIDE 143

Modular Build in C++

slide-144
SLIDE 144

Modular Build in C++

slide-145
SLIDE 145

Modular Build in C++

slide-146
SLIDE 146

Modular Build in C++

slide-147
SLIDE 147

MODULES IN… .NET

slide-148
SLIDE 148

From C++ to C# Library ¡ OS ¡ File ¡type ¡ Sta2c ¡ Win ¡ *.lib ¡ *nix ¡ *.a ¡ Dynamic ¡ Win ¡ *.dll ¡ *nix ¡ *.so ¡

slide-149
SLIDE 149

From C++ to C# Library ¡ Win ¡ File ¡type ¡ Sta2c ¡ Win ¡ *.lib ¡ Dynamic ¡ Win ¡ *.dll ¡

slide-150
SLIDE 150

Library ¡ Win ¡ File ¡type ¡ Sta2c ¡ Win ¡ *.lib ¡ Dynamic ¡ Win ¡ *.dll ¡ But is it the Only Change?

slide-151
SLIDE 151

, Baby!

slide-152
SLIDE 152

Modular Build in .NET

slide-153
SLIDE 153

Modular Build in .NET

+ ¡

slide-154
SLIDE 154

Modular Build in .NET

+ ¡

slide-155
SLIDE 155

Modular Build in .NET

+ ¡

slide-156
SLIDE 156

DEMO TIME!

slide-157
SLIDE 157

The Common Factor

+ ¡

slide-158
SLIDE 158