Zum Hauptinhalt springen
Dekorationsartikel gehören nicht zum Leistungsumfang.
Clean SAPUI5
A Style Guide for Developers
Buch von Daniel Bertolozi (u. a.)
Sprache: Englisch

70,80 €*

inkl. MwSt.

Versandkostenfrei per Post / DHL

auf Lager, Lieferzeit 2-4 Werktage

Kategorien:
Beschreibung

SAPUI5 code needs to be easy to read and easy to update. Clean up your code with this guide from the experts! Learn how to leverage JavaScript features to write better SAPUI5 code. Then walk through detailed code examples and explanations for using modules, classes, functions, names, variables, literals, comments, code metrics, and more. Get the best practices you need for formatting, testing, implementation, and beyond!

In this book, you'll learn about:

a. Key Concepts
Understand the foundation of SAPUI5: JavaScript. Explore key JavaScript ES6 features such as arrow functions, spread syntax, and more. Then walk through different types of SAPUI5 projects, from library projects to freestyle applications.

b. Best Practices
Learn the rules for clean code. Dive into best practices for decoupling modules, structuring functions, declaring variables and literals, using control flow statements and loops, handling errors, performing automated tests, and more.

c. Practical Examples
Put theory into practice. Use detailed code examples for each concept to help you differentiate between clean and messy SAPUI5 code.

Highlights include:

1) JavaScript
2) Modules and classes
3) Functions
4) Naming
5) Variables and literals
6) Control flow
7) Formatting
8) Error handling
9) Comments
10) Static code checks
11) Testing
12) Implementation

SAPUI5 code needs to be easy to read and easy to update. Clean up your code with this guide from the experts! Learn how to leverage JavaScript features to write better SAPUI5 code. Then walk through detailed code examples and explanations for using modules, classes, functions, names, variables, literals, comments, code metrics, and more. Get the best practices you need for formatting, testing, implementation, and beyond!

In this book, you'll learn about:

a. Key Concepts
Understand the foundation of SAPUI5: JavaScript. Explore key JavaScript ES6 features such as arrow functions, spread syntax, and more. Then walk through different types of SAPUI5 projects, from library projects to freestyle applications.

b. Best Practices
Learn the rules for clean code. Dive into best practices for decoupling modules, structuring functions, declaring variables and literals, using control flow statements and loops, handling errors, performing automated tests, and more.

c. Practical Examples
Put theory into practice. Use detailed code examples for each concept to help you differentiate between clean and messy SAPUI5 code.

Highlights include:

1) JavaScript
2) Modules and classes
3) Functions
4) Naming
5) Variables and literals
6) Control flow
7) Formatting
8) Error handling
9) Comments
10) Static code checks
11) Testing
12) Implementation

Über den Autor
Daniel Bertolozi is a software developer at SAP, with more than 5 years of experience focused on SAP Fiori development. He has worked on several projects implementing SAPUI5 applications (in JavaScript and TypeScript) applying best practices for code quality, and he is actively engaged in disseminating agile software engineering practices around SAP. Daniel's approach to software development follows Robert C. Martin's phrase: "The only way to go fast, is to go well". If quality decreases, speed eventually will too, and that's what we want to avoid.
Zusammenfassung
Create descriptive program names, write strong comments, and format code correctly
Inhaltsverzeichnis
... Preface ... 17

... Who This Book Is For ... 17

... How This Book Is Organized ... 18

... Acknowledgments ... 20

... Conclusion ... 22

1 ... Introduction ... 23

1.1 ... What Is Clean SAPUI5? ... 23

1.2 ... How to Get Started with Clean SAPUI5 ... 26

1.3 ... How to Handle Legacy Code ... 27

1.4 ... How to Check Code Automatically ... 29

1.5 ... How Does Clean SAPUI5 Relate to Other Guides? ... 29

1.6 ... Summary ... 30

2 ... JavaScript and SAPUI5 ... 31

2.1 ... JavaScript ES6+ Features ... 32

2.2 ... TypeScript ... 106

2.3 ... Summary ... 117

3 ... Project Structure ... 119

3.1 ... Components in SAPUI5 ... 119

3.2 ... Important Artifacts ... 122

3.3 ... Freestyle Applications ... 129

3.4 ... SAP Fiori Elements ... 132

3.5 ... Library Projects ... 139

3.6 ... Model-View-Controller Assets ... 142

3.7 ... Summary ... 144

4 ... Modules and Classes ... 147

4.1 ... Controller Inflation ... 148

4.2 ... Module Lifecycle ... 179

4.3 ... Reusability and Testability ... 187

4.4 ... Service Modules versus Class Modules ... 197

4.5 ... Summary ... 204

5 ... Functions ... 205

5.1 ... Function Definition ... 205

5.2 ... The Function Object ... 206

5.3 ... Instance Methods ... 208

5.4 ... Event Handlers and Callbacks ... 211

5.5 ... Callback Execution Context ... 211

5.6 ... Getters and Setters ... 213

5.7 ... Anonymous Functions ... 215

5.8 ... Function Parameters ... 217

5.9 ... Promises ... 230

5.10 ... Generators ... 236

5.11 ... Function Body ... 237

5.12 ... Invoking Functions ... 245

5.13 ... Closures ... 247

5.14 ... Summary ... 248

6 ... Naming ... 249

6.1 ... Descriptive Names ... 249

6.2 ... Domain Terms ... 251

6.3 ... Design Patterns ... 252

6.4 ... Consistency ... 253

6.5 ... Shortening Names ... 254

6.6 ... Noise Words ... 255

6.7 ... Casing ... 255

6.8 ... Classes and Enums ... 257

6.9 ... Functions and Methods ... 258

6.10 ... Variables and Parameters ... 260

6.11 ... Private Members ... 265

6.12 ... Namespaces ... 267

6.13 ... Control IDs ... 268

6.14 ... Hungarian Notation ... 270

6.15 ... Alternative Rules ... 271

6.16 ... Summary ... 273

7 ... Variables and Literals ... 275

7.1 ... Variables ... 275

7.2 ... Literals ... 279

7.3 ... Summary ... 297

8 ... Control Flow ... 299

8.1 ... Conditionals ... 299

8.2 ... Loops ... 303

8.3 ... Conditional Complexity ... 306

8.4 ... Summary ... 313

9 ... Error Handling ... 315

9.1 ... throw and try/catch Statements ... 315

9.2 ... Using Error Objects ... 317

9.3 ... Error Handling Using Messages ... 318

9.4 ... Error Handling Using Controls ... 320

9.5 ... Error Handling Best Practices ... 323

9.6 ... Summary ... 327

10 ... Formatting ... 329

10.1 ... Motivation ... 329

10.2 ... Vertical versus Horizontal Formatting ... 330

10.3 ... Indentation ... 339

10.4 ... XML Views ... 341

10.5 ... Additional Considerations ... 347

10.6 ... Formatting for TypeScript in SAPUI5 ... 351

10.7 ... Building and Maintaining a Code Style Guide ... 361

10.8 ... Formatting Tools ... 363

10.9 ... Summary ... 368

11 ... Comments ... 369

11.1 ... Express Yourself in Code ... 369

11.2 ... The Good: Comment Placement and Usage ... 371

11.3 ... The Bad: Comments to Avoid or Refactor ... 381

11.4 ... The Ugly: Special Comments ... 391

11.5 ... Summary ... 394

12 ... Static Code Checks and Code Metrics ... 397

12.1 ... Linting ... 399

12.2 ... Code Metrics ... 417

12.3 ... Summary ... 437

13 ... Testing ... 439

13.1 ... Principles ... 440

13.2 ... Code under Test ... 451

13.3 ... Injection ... 453

13.4 ... Test Methods and Journeys ... 458

13.5 ... Test Data ... 461

13.6 ... Assertions ... 464

13.7 ... Summary ... 470

14 ... TypeScript and Related Technologies ... 471

14.1 ... TypeScript ... 471

14.2 ... Web Components ... 485

14.3 ... Fundamental Library ... 494

14.4 ... Summary ... 498

15 ... Implementing Clean SAPUI5 ... 499

15.1 ... A Common Understanding among Team Members ... 499

15.2 ... Collective Code Ownership ... 500

15.3 ... Clean Code Developer Initiative ... 501

15.4 ... Tackling the Broken Window Effect ... 503

15.5 ... Code Review and Learning ... 506

15.6 ... Clean Code Advisors ... 509

15.7 ... Learning Techniques ... 510

15.8 ... Continuous Learning in Cross-Functional Teams ... 514

15.9 ... Summary ... 516

... The Authors ... 517

... Index ... 519
Details
Erscheinungsjahr: 2022
Fachbereich: Programmiersprachen
Genre: Importe, Informatik
Rubrik: Naturwissenschaften & Technik
Medium: Buch
Reihe: SAP Press Englisch
Inhalt: 530 S.
ISBN-13: 9781493222285
ISBN-10: 1493222287
Sprache: Englisch
Herstellernummer: 459/22228
Einband: Gebunden
Autor: Bertolozi, Daniel
Buchholz, Arnaud
Haeuptle, Klaus
Jordão, Rodrigo
Lehmann, Christian
Vaithianathan, Narendran Natarajan
Hersteller: Rheinwerk Verlag GmbH
Rheinwerk Publishing Inc.
Verantwortliche Person für die EU: Rheinwerk Verlag GmbH, Rheinwerkallee 4, D-53227 Bonn, service@rheinwerk-verlag.de
Maße: 260 x 185 x 36 mm
Von/Mit: Daniel Bertolozi (u. a.)
Erscheinungsdatum: 23.11.2022
Gewicht: 1,292 kg
Artikel-ID: 121414507
Über den Autor
Daniel Bertolozi is a software developer at SAP, with more than 5 years of experience focused on SAP Fiori development. He has worked on several projects implementing SAPUI5 applications (in JavaScript and TypeScript) applying best practices for code quality, and he is actively engaged in disseminating agile software engineering practices around SAP. Daniel's approach to software development follows Robert C. Martin's phrase: "The only way to go fast, is to go well". If quality decreases, speed eventually will too, and that's what we want to avoid.
Zusammenfassung
Create descriptive program names, write strong comments, and format code correctly
Inhaltsverzeichnis
... Preface ... 17

... Who This Book Is For ... 17

... How This Book Is Organized ... 18

... Acknowledgments ... 20

... Conclusion ... 22

1 ... Introduction ... 23

1.1 ... What Is Clean SAPUI5? ... 23

1.2 ... How to Get Started with Clean SAPUI5 ... 26

1.3 ... How to Handle Legacy Code ... 27

1.4 ... How to Check Code Automatically ... 29

1.5 ... How Does Clean SAPUI5 Relate to Other Guides? ... 29

1.6 ... Summary ... 30

2 ... JavaScript and SAPUI5 ... 31

2.1 ... JavaScript ES6+ Features ... 32

2.2 ... TypeScript ... 106

2.3 ... Summary ... 117

3 ... Project Structure ... 119

3.1 ... Components in SAPUI5 ... 119

3.2 ... Important Artifacts ... 122

3.3 ... Freestyle Applications ... 129

3.4 ... SAP Fiori Elements ... 132

3.5 ... Library Projects ... 139

3.6 ... Model-View-Controller Assets ... 142

3.7 ... Summary ... 144

4 ... Modules and Classes ... 147

4.1 ... Controller Inflation ... 148

4.2 ... Module Lifecycle ... 179

4.3 ... Reusability and Testability ... 187

4.4 ... Service Modules versus Class Modules ... 197

4.5 ... Summary ... 204

5 ... Functions ... 205

5.1 ... Function Definition ... 205

5.2 ... The Function Object ... 206

5.3 ... Instance Methods ... 208

5.4 ... Event Handlers and Callbacks ... 211

5.5 ... Callback Execution Context ... 211

5.6 ... Getters and Setters ... 213

5.7 ... Anonymous Functions ... 215

5.8 ... Function Parameters ... 217

5.9 ... Promises ... 230

5.10 ... Generators ... 236

5.11 ... Function Body ... 237

5.12 ... Invoking Functions ... 245

5.13 ... Closures ... 247

5.14 ... Summary ... 248

6 ... Naming ... 249

6.1 ... Descriptive Names ... 249

6.2 ... Domain Terms ... 251

6.3 ... Design Patterns ... 252

6.4 ... Consistency ... 253

6.5 ... Shortening Names ... 254

6.6 ... Noise Words ... 255

6.7 ... Casing ... 255

6.8 ... Classes and Enums ... 257

6.9 ... Functions and Methods ... 258

6.10 ... Variables and Parameters ... 260

6.11 ... Private Members ... 265

6.12 ... Namespaces ... 267

6.13 ... Control IDs ... 268

6.14 ... Hungarian Notation ... 270

6.15 ... Alternative Rules ... 271

6.16 ... Summary ... 273

7 ... Variables and Literals ... 275

7.1 ... Variables ... 275

7.2 ... Literals ... 279

7.3 ... Summary ... 297

8 ... Control Flow ... 299

8.1 ... Conditionals ... 299

8.2 ... Loops ... 303

8.3 ... Conditional Complexity ... 306

8.4 ... Summary ... 313

9 ... Error Handling ... 315

9.1 ... throw and try/catch Statements ... 315

9.2 ... Using Error Objects ... 317

9.3 ... Error Handling Using Messages ... 318

9.4 ... Error Handling Using Controls ... 320

9.5 ... Error Handling Best Practices ... 323

9.6 ... Summary ... 327

10 ... Formatting ... 329

10.1 ... Motivation ... 329

10.2 ... Vertical versus Horizontal Formatting ... 330

10.3 ... Indentation ... 339

10.4 ... XML Views ... 341

10.5 ... Additional Considerations ... 347

10.6 ... Formatting for TypeScript in SAPUI5 ... 351

10.7 ... Building and Maintaining a Code Style Guide ... 361

10.8 ... Formatting Tools ... 363

10.9 ... Summary ... 368

11 ... Comments ... 369

11.1 ... Express Yourself in Code ... 369

11.2 ... The Good: Comment Placement and Usage ... 371

11.3 ... The Bad: Comments to Avoid or Refactor ... 381

11.4 ... The Ugly: Special Comments ... 391

11.5 ... Summary ... 394

12 ... Static Code Checks and Code Metrics ... 397

12.1 ... Linting ... 399

12.2 ... Code Metrics ... 417

12.3 ... Summary ... 437

13 ... Testing ... 439

13.1 ... Principles ... 440

13.2 ... Code under Test ... 451

13.3 ... Injection ... 453

13.4 ... Test Methods and Journeys ... 458

13.5 ... Test Data ... 461

13.6 ... Assertions ... 464

13.7 ... Summary ... 470

14 ... TypeScript and Related Technologies ... 471

14.1 ... TypeScript ... 471

14.2 ... Web Components ... 485

14.3 ... Fundamental Library ... 494

14.4 ... Summary ... 498

15 ... Implementing Clean SAPUI5 ... 499

15.1 ... A Common Understanding among Team Members ... 499

15.2 ... Collective Code Ownership ... 500

15.3 ... Clean Code Developer Initiative ... 501

15.4 ... Tackling the Broken Window Effect ... 503

15.5 ... Code Review and Learning ... 506

15.6 ... Clean Code Advisors ... 509

15.7 ... Learning Techniques ... 510

15.8 ... Continuous Learning in Cross-Functional Teams ... 514

15.9 ... Summary ... 516

... The Authors ... 517

... Index ... 519
Details
Erscheinungsjahr: 2022
Fachbereich: Programmiersprachen
Genre: Importe, Informatik
Rubrik: Naturwissenschaften & Technik
Medium: Buch
Reihe: SAP Press Englisch
Inhalt: 530 S.
ISBN-13: 9781493222285
ISBN-10: 1493222287
Sprache: Englisch
Herstellernummer: 459/22228
Einband: Gebunden
Autor: Bertolozi, Daniel
Buchholz, Arnaud
Haeuptle, Klaus
Jordão, Rodrigo
Lehmann, Christian
Vaithianathan, Narendran Natarajan
Hersteller: Rheinwerk Verlag GmbH
Rheinwerk Publishing Inc.
Verantwortliche Person für die EU: Rheinwerk Verlag GmbH, Rheinwerkallee 4, D-53227 Bonn, service@rheinwerk-verlag.de
Maße: 260 x 185 x 36 mm
Von/Mit: Daniel Bertolozi (u. a.)
Erscheinungsdatum: 23.11.2022
Gewicht: 1,292 kg
Artikel-ID: 121414507
Sicherheitshinweis

Ähnliche Produkte

Ähnliche Produkte