Discover the Ada programming language by being gently guided through the various parts of the language and its latest available stable release. The goal in this book is to slowly ease you into the different topics. It is understood that you do not always have ample free time, so the text is easy to
Beginning Ballerina Programming: From Novice to Professional
â Scribed by Anjana Fernando, Lakmal Warusawithana
- Publisher
- Apress
- Year
- 2020
- Tongue
- English
- Leaves
- 344
- Category
- Library
No coin nor oath required. For personal study only.
⌠Synopsis
Discover the Ballerina programming language for next-generation microservices and cloud-native application development. This book shows you that Ballerina is a cutting-edge programming language which incorporates many of the latest technological advancements in programming language theory. You'll learn variables and types, modules and functions, flow control, error handling, concurrency, I/O, cloud/network programming, persistence and data access, security and more.
Additionally, Beginning Ballerina Programming introduces many foundation computer science topics along the way and doesnât assume much prior knowledge. For example, when introducing transport-level security, you will get a brief introduction to public-key cryptography, how it is different from private-key cryptography, and why it is needed. This provides an added bonus for you to learn something new and general in computer science.
After reading and using this book, you'll be proficient with Ballerina and cloud-first programming and be able to apply these concepts and techniques to your next cloud application developments.
What You'll Learn
¡ Start programming with Ballerina
¡ Gain the basics of network communication and programming
¡ Obtain a solid understanding of services/API development
¡ Effective use of concurrency in programming
¡ Learn the basics of information security and its applications
¡ Persistent data storage and access
Who This Book Is For
Absolute beginners in computer programming: No prior experience with computer programming is expected. This can also be a reference book for experienced developers in other languages, who want to learn a modern programming language.
⌠Table of Contents
Table of Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Getting Started
Computers and Coding
Programming Languages
Computer Organization
CPU
Instruction Sets
Primary Memory
Why Binary and Hexadecimal Values?
Input/Output
The First Ballerina Program
Installing Ballerina
Ballerina IDE Plug-in
Hello, World!
Comments
Summary
Chapter 2: Programming Basics
Types and Variables
Naming Variables
Simple Types
Boolean Type
Integer Types
Floating-Point Types
Type Inference with var
Why both decimal and float?
Numeric Conversions
string Type
Escape Sequences
nil Type
Mathematical Calculations
Arithmetic Operators
Assignment Operators
Making Decisions
Comparison Operators
Logical Operators
AND Operator
OR Operator
NOT Operator
Combining Logical Operators
Flow Control
if Statement
Nested if/else Statements
Ternary Conditional Operator
Loops
while Loop
break
continue
foreach Loop
Variable Scopes
Making Sense of Bits and Bytes
Bitwise Operators
Bitmasks, Flags, and Encoding
Functions
Functional Decomposition
Summary
Chapter 3: Lists, Mappings, and Objects
Union Types
Optional Types
Any Type
Arrays
Array Creation Modes
Dynamic-Length Arrays
Array Operations
push/pop
shift/unshift
slice
Fixed-Length Arrays
Iterating Arrays
Multidimensional Arrays
Keeping Inside the Bounds
Tuples
Defining New Types
Maps
Map Operations
Iterating a Map
Performance Considerations of Maps and Arrays
Computational Complexity for Map Operations
Records
Open and Closed Records
Record Rest Fields
Subtyping in Records
Objects
Object Methods
Subtyping in Objects
Abstract Objects
Objects or Records?
Reference Types and Value Types
Deep and Exact Equality
Constants and Singleton Types
Summary
Chapter 4: Code Organization
Ballerina Projects and Modules
Single Source File Programs
Run or Build?
Ballerina Projects
Ballerina Modules
Importing Modules
Dependencies and Versions
Java Dependencies
Adding Modules to a Project
Identifier Visibility in Modules
Implementing Modules
calfunctions
Recursion
Recursion vs. Iteration
Bubble Sort
calparser
calapp
Building Modules
Running an Application
Documentation
Generating Documentation
Coding Conventions
Indentation and Maximum Column Size
Spacing: Keywords, Types, and Identifiers
Code Blocks
Line Breaks
Testing
Unit Testing
Integration Testing
Ballerina Test Framework
Calculator Parser and Algorithms Testing
Calculator App Testing
Sharing and Reuse
Publishing Modules
Summary
Chapter 5: Error Handling
Reacting to Errors
Creating Your Own Errors
Creating Custom Error Types
Error Subtyping
Creating Error Values
Expected vs. Unexpected Errors
Trapping Errors
Is It Time to panic?
Creating an Error Type Hierarchy
Error Handling Case Study: Connected Banking
Common Banking Operations
Online Banking
Error Chaining
check and checkpanic
Summary
Chapter 6: Concurrency
Threads and Processes
Concurrency and Parallelism
Synchronous and Asynchronous
Multitasking
Coroutines
Understanding the Ballerina Concurrency Model
Asynchronous Programming
Workers
Workers with Interaction
Fork Statement
Fork Variable Access
Summary
Chapter 7: Files and I/O
Programmed I/O
Direct Memory Access
Ballerina I/O Module
Channels
Byte Channels
Character Channels
JSON I/O
Record Channels
File and File Path Modules
Summary
Chapter 8: Programming the Network
The Basics of Computer Networks
ISO OSI Protocol
Layer 1: Physical Layer
Layer 2: Data Link Layer
Layer 3: Network Layer
Layer 4: Transport Layer
Layer 5: Session Layer
Layer 6: Presentation Layer
Layer 7: Application Layer
TCP/IP Protocol
Link Layer
Internet Layer
Transport Layer
Application Layer
Packet Encapsulation
Connection Models
Distributed Computing Architectures
Client-Server
Peer-to-Peer
Three-Tier
N-tier
Communication Flows
Synchronous Communication
Asynchronous Communication
Streaming Communication
Publisher/Subscriber Communication
HTTP Protocol
Endpoint and Service
Writing Network-Distributed Programs
Listener
Service/Resource
http:Request Object
http:Caller Object
Simple HTTP Service
Use Case: HTTP RESTful Service
HTTP Client
gRPC Service
Summary
Chapter 9: Information Security
Core Concepts
Confidentiality
Integrity
Availability
Authentication/Authorization
Nonrepudiation
Information Security in Action
Ciphers: Enforcing Confidentiality
XOR Cipher
Is XOR Cipher Secure?
Implementation
Symmetric-Key Ciphers
Block Ciphers
Stream Ciphers
Asymmetric-Key Ciphers
Digital Signatures: Authenticity, Integrity, and Nonrepudiation
Public Key Infrastructure
Digital Certificates
SSL/TLS
Cryptography API
Hashing
Signing
HMAC
Private Key Crypto
Public Key Crypto
Identity and Access Control
Authentication
File-Based Basic Authentication
Authorization
Ballerina Basic Auth with Scope
Access Tokens
JWT
OAuth 2.0
Secure Programming
Taint Checking
Summary
Chapter 10: Database Programming
Relational Database Model
Entity-Relationship Modeling
Introduction to SQL
Data Definition Language
Creating Tables
Data Definition Language
SQL INSERT
Identity Columns
SQL SELECT
Filtering Records
Joining Tables
SQL UPDATE
SQL DELETE
Ballerina SQL API
Database Client Initialization
JDBC Drivers
Database Client Operations
Update
Select
Creating Data Services
Designing the Data Service
Implementing the Data Service
Initializing the Database
When to Create an Index
Making Requests
Creating Accounts
Benefit of Batch Operations
Accounts Creation in Action
Retrieve Account Information
Accounts Retrieval in Action
Update and Delete Account Information
Accounts Update/Delete in Action
Funds Transfer
Transactions
Funds Transfer in Action
Summary
Appendix A: Numbers and Representation
Signed Numbers and Twoâs Complement Notation
Floating-Point Numbers
Index
đ SIMILAR VOLUMES
<p><p>Get started with Perl 5 and learn the important core concepts of Perl programming, such as variables, flow control, expressions, and I/O. Additionally, this book covers pattern matching and shows that Perl is extremely flexible and powerful, and that it isnât afraid of the cloud. After reading
<p>Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously structur
<p><p>Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously struc
Gain a gentle introduction to the world of Ring programming with clarity as a first concern using a lot of practical examples. The first part lays the foundations of the language and its basic features (data types, control structures, functions, and classes). The unique way to rigorously structure R