0% found this document useful (0 votes)
58 views7 pages

Clean Code - Introduction & Naming Conventions

Clean Code by Robert C. Martin This document discusses Clean Code by Robert C. Martin. It provides an overview of concurrency and the benefits of decoupling programs. Some common myths and misconceptions about concurrency are addressed. Principles for writing concurrent programs are outlined, including limiting shared data and making threads as independent as possible. Common concurrency problems like producer-consumer, readers-writers, and dining philosophers are mentioned. The importance of understanding dependencies between synchronized methods is stressed.

Uploaded by

Ankit Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views7 pages

Clean Code - Introduction & Naming Conventions

Clean Code by Robert C. Martin This document discusses Clean Code by Robert C. Martin. It provides an overview of concurrency and the benefits of decoupling programs. Some common myths and misconceptions about concurrency are addressed. Principles for writing concurrent programs are outlined, including limiting shared data and making threads as independent as possible. Common concurrency problems like producer-consumer, readers-writers, and dining philosophers are mentioned. The importance of understanding dependencies between synchronized methods is stressed.

Uploaded by

Ankit Gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Clean Code

Robert C. Martin

Oct 18, 2019

Iris Software, Inc.

Confidential 1 When IT matters, we deliver.


Confidential
Why Concurrency

Question: What is Concurrency ?

Answer:

 Concurrency is the ability to run several programs or several parts of a program in parallel.

 Concurrency is a decoupling strategy. It helps us to decouple what gets done from when it gets done.

“In single-threaded applications what and when are so strongly coupled”

Question: What are the benefits of Decoupling ?

Answer:
 Decoupling what from when can dramatically improve both the throughput and structures of an
application.

 From a structural point of view the application looks like many little collaborating computers rather
than one big main loop.

 This can make the system easier to understand and offers some powerful ways to separate concerns.
for example, the standard “Servlet” model of Web applications.

Confidential 2 When IT matters, we deliver.


Myths and Misconceptions

Question: What are Myths and Misconceptions ?

Answer:
 Concurrency always improves performance.

 Design does not change when writing concurrent programs. (The decoupling of what from
when usually has a huge effect on the structure of the system).

 Understanding concurrency issues is not important when working with a container such as
a Web or EJB container.

Confidential 3 When IT matters, we deliver.


Concurrency Defence Principles

 Single Responsibility Principle

 Limit the Scope of Data

 Use Copies of Data

 Threads Should Be as Independent as Possible

 Know Your Library

 Use the provided thread-safe collections.

 Use the executor framework for executing unrelated tasks.

 Use nonblocking solutions when possible.

Confidential 4 When IT matters, we deliver.


Problem Statements

 Producer-Consumer

 Readers-Writers

 Dining Philosophers

Confidential 5 When IT matters, we deliver.


Learn these basic algorithms and understand their solutions

 Beware Dependencies Between Synchronized Methods

Confidential 6 When IT matters, we deliver.


Thank You!

Confidential 7 When IT matters, we deliver.

You might also like