Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Hands-On Design Patterns and Best Practices with Julia
Hands-On Design Patterns and Best Practices with Julia

Hands-On Design Patterns and Best Practices with Julia: Proven solutions to common problems in software design for Julia 1.x

eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Hands-On Design Patterns and Best Practices with Julia

Design Patterns and Related Principles

Nowadays, learning and applying design patterns is an important aspect of software engineering. Design patterns are like water – you can't live without them. Don't believe me? Just ask hiring managers, and you will find that many of them have design patterns in their job postings as well as related questions in job interviews. It is a common belief that design patterns are important ingredients for software development and everyone should know them.

In this chapter, we will provide some context about why design patterns are useful and how they have served us well in the past few decades. By understanding the motivation behind design patterns, we will be able to set forth a set of guiding principles for developing software. The following topics will be discussed in this chapter:

  • The history of design patterns 
  • Software...

The history of design patterns

Design patterns is not a new concept to computer programmers. Since personal computers became more affordable and popular in the 1980s, the programming profession flourished and a lot of code was written for a variety of applications.

I remember that, when I was 14 years old, learning the GOTO statement for a BASIC program was one of the coolest things. It literally allowed me to take a control flow to a different part of the code at any time. Perhaps not too surprisingly, when I learned about structured programming and the Pascal language in college, I started to realize how GOTO statements produce messy spaghetti code. Using GOTO for branching purposes is a pattern. It's just a bad one because it makes code difficult to understand, follow, and debug. In today's lingua franca, we call them anti-patterns. When it comes to...

Software design principles

While this book does not cover object-oriented programming, some object-oriented design principles are universal and could be applied to any programming language and paradigm. Here, we will take a look at some of the most well-known design principles. In particular, we will cover the following:

  • SOLID: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion
  • DRY: Don't Repeat Yourself
  • KISS: Keep It Simple, Stupid!
  • POLA: Principle of Least Astonishment
  • YAGNI: You Aren't Gonna Need It
  • POLP: Principle of Least Privilege

Let's start with SOLID.

SOLID

The SOLID principle consists of the following:

  • S: Single Responsibility Principle
  • O: Open...

Software quality objectives

Everyone likes beautiful design. I do, too. But, the use of design patterns is not just to make something look good. Everything we do should have a purpose.

The GoF classified object-oriented design patterns as creational, structural, and behavioral. For Julia, let's take a different perspective and classify our patterns by their respective software quality objectives as follows:

  • Reusability
  • Performance
  • Maintenance
  • Safety

Let's understand each of these in the following sections.

Reusability

People often talk about top-down and bottom-up approaches when designing software.

The top-down approach starts with a large problem and breaks it down into a set of smaller problems. Then, if the...

Summary

In this chapter, we started by going back in time and reviewing the history of design patterns. We discussed why design patterns can be useful for software professionals and how we would like to organize design patterns in this book given what we have learned in the past. 

We went over several key software design principles that can be applied universally in any programming language, as it is important that we keep them in mind when developing code and applying design patterns in Julia. We covered SOLID, DRY, KISS, POLA, YAGNI, and POLP. These design principles are well known and well received by the object-oriented programming community.

Finally, we discussed some software quality objectives that we want to achieve by using design patterns. In this book, we have decided to focus on reusability, maintainability, performance, and safety objectives. We also appreciated...

Questions

Review the following questions to reinforce your understanding of the subjects in this chapter. Answers are provided at the back of the book:

  1. What are the benefits of using design patterns?
  2. Name some key design principles.
  3. What problem does the Open/Closed Principle solve?
  4. Why is interface segregation important for software reusability?
  5. What are the simplest ways to keep an application maintainable?
  6. What is a good practice for avoiding over-engineered and bloated software?
  7. How does memory usage affect system performance?
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore useful design patterns along with object-oriented programming in Julia 1.0
  • Implement macros and metaprogramming techniques to make your code faster, concise, and efficient
  • Develop the skills necessary to implement design patterns for creating robust and maintainable applications

Description

Design patterns are fundamental techniques for developing reusable and maintainable code. They provide a set of proven solutions that allow developers to solve problems in software development quickly. This book will demonstrate how to leverage design patterns with real-world applications. Starting with an overview of design patterns and best practices in application design, you'll learn about some of the most fundamental Julia features such as modules, data types, functions/interfaces, and metaprogramming. You'll then get to grips with the modern Julia design patterns for building large-scale applications with a focus on performance, reusability, robustness, and maintainability. The book also covers anti-patterns and how to avoid common mistakes and pitfalls in development. You'll see how traditional object-oriented patterns can be implemented differently and more effectively in Julia. Finally, you'll explore various use cases and examples, such as how expert Julia developers use design patterns in their open source packages. By the end of this Julia programming book, you'll have learned methods to improve software design, extensibility, and reusability, and be able to use design patterns efficiently to overcome common challenges in software development.

Who is this book for?

This book is for beginner to intermediate-level Julia programmers who want to enhance their skills in designing and developing large-scale applications.

What you will learn

  • Master the Julia language features that are key to developing large-scale software applications
  • Discover design patterns to improve overall application architecture and design
  • Develop reusable programs that are modular, extendable, performant, and easy to maintain
  • Weigh up the pros and cons of using different design patterns for use cases
  • Explore methods for transitioning from object-oriented programming to using equivalent or more advanced Julia techniques

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 17, 2020
Length: 532 pages
Edition : 1st
Language : English
ISBN-13 : 9781838646615
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Jan 17, 2020
Length: 532 pages
Edition : 1st
Language : English
ISBN-13 : 9781838646615
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 94.97
Julia Programming Projects
€36.99
Hands-On Design Patterns and Best Practices with Julia
€32.99
Julia High Performance
€24.99
Total 94.97 Stars icon

Table of Contents

18 Chapters
Section 1: Getting Started with Design Patterns Chevron down icon Chevron up icon
Design Patterns and Related Principles Chevron down icon Chevron up icon
Section 2: Julia Fundamentals Chevron down icon Chevron up icon
Modules, Packages, and Data Type Concepts Chevron down icon Chevron up icon
Designing Functions and Interfaces Chevron down icon Chevron up icon
Macros and Metaprogramming Techniques Chevron down icon Chevron up icon
Section 3: Implementing Design Patterns Chevron down icon Chevron up icon
Reusability Patterns Chevron down icon Chevron up icon
Performance Patterns Chevron down icon Chevron up icon
Maintainability Patterns Chevron down icon Chevron up icon
Robustness Patterns Chevron down icon Chevron up icon
Miscellaneous Patterns Chevron down icon Chevron up icon
Anti-Patterns Chevron down icon Chevron up icon
Traditional Object-Oriented Patterns Chevron down icon Chevron up icon
Section 4: Advanced Topics Chevron down icon Chevron up icon
Inheritance and Variance Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(14 Ratings)
5 star 78.6%
4 star 14.3%
3 star 0%
2 star 7.1%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




B. G. Mar 13, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been programming Julia for 3-4 months now and like the language more every day.But, the paucity of up to date documentation on advanced language features can be frustrating. The information is either scattered across a million web pages or doesn't seem to exist anywhere. Until this book put it all in one place.I have purchased 4 or 5 other books on Julia but none have the depth and breadth of coverage of this one. This book is also more up to date, covering features in language version 1.3, the most recent release.The coverage of both basic and advanced topics is extensive. Every concept is clearly explained. I learn something new and useful on almost every page.If you are new to programming Think Julia is probably a better place to start, even though it is slightly out of date. But if you know how to program and want to unlock the power of Julia this is, by far, the best book available.
Amazon Verified review Amazon
Daniel Nov 10, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Très bien fait, réponds à mes attentes.
Amazon Verified review Amazon
Scott M. Mar 17, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been programming since Turbo Pascal in the early 80s and have deployed significant projects in maybe a dozen languages. I've read many dozens of programming books. What I'm trying to say is this isn't my first rodeo.This book is one of the best programming books I've ever read. The structure is easy to digest --- the sections are short, the points are clearly made, and many examples (that show both what works and what doesn't work) are provided. I had never read a technical book on a Kindle that actually was comfortable and usable. But the design worked very well.In addition to all of this, having the author go through the 23 GoF patterns and showing in detail how they can be handled in Julia was absolutely masterful.My only wish is that this book had an index. A minor nit to pick, but it would have been nice.This was my first book on Julia. I'm sure I will be learning more about this language through Udemy, online forums, and more. But I now feel that I understand why this language is so compelling and is a tool that I need in my toolbox. Thanks, Mr. Kwong!
Amazon Verified review Amazon
A. Loudenback Feb 27, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have been really enjoying this book, after having used Julia for a couple of years this has solidified a lot of concepts for me and introduced me to new ones. The examples are relevant and simple, without feeling contrived. The book covers a lot of the unique/fundamental benefits of Julia (multiple dispatch, parametric types, meta-programming, performance) and helps you avoid pitfalls (such as over-crowding your global package space by using smart package management).
Amazon Verified review Amazon
Christian Jespersen Dec 04, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book was much more beneficial than I expected. Increasing maintainability and extendability significantly.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.