Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Practical Design Patterns for Java Developers
Practical Design Patterns for Java Developers

Practical Design Patterns for Java Developers: Hone your software design skills by implementing popular design patterns in Java

Arrow left icon
Profile Icon Miroslav Wengner
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7 (20 Ratings)
Paperback Feb 2023 266 pages 1st Edition
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m
Arrow left icon
Profile Icon Miroslav Wengner
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7 (20 Ratings)
Paperback Feb 2023 266 pages 1st Edition
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Key benefits

  • Decouple logic across objects with dependency injection by creating various vehicles with features
  • Finalize vehicle construction by chaining handlers using the Chain of Responsibility Pattern
  • Plan and execute an advanced vehicle sensor initiation with the Scheduler Pattern

Description

Design patterns are proven solutions to standard problems in software design and development, allowing you to create reusable, flexible, and maintainable code. This book enables you to upskill by understanding popular patterns to evolve into a proficient software developer. You’ll start by exploring the Java platform to understand and implement design patterns. Then, using various examples, you’ll create different types of vehicles or their parts to enable clarity in design pattern thinking, along with developing new vehicle instances using dedicated design patterns to make the process consistent. As you progress, you’ll find out how to extend vehicle functionalities and keep the code base structure and behavior clean and shiny. Concurrency plays an important role in application design, and you'll learn how to employ a such design patterns with the visualization of thread interaction. The concluding chapters will help you identify and understand anti-pattern utilization in the early stages of development to address refactoring smoothly. The book covers the use of Java 17+ features such as pattern matching, switch cases, and instances of enhancements to enable productivity. By the end of this book, you’ll have gained practical knowledge of design patterns in Java and be able to apply them to address common design problems.

Who is this book for?

If you are an intermediate-level Java developer or software architect looking to learn the practical implementation of software design patterns in Java, then this book is for you. No prior knowledge of design patterns is required, but an understanding of Java programming is necessary.

What you will learn

  • Understand the most common problems that can be solved using Java design patterns
  • Uncover Java building elements, their usages, and concurrency possibilities
  • Optimize a vehicle memory footprint with the Flyweight Pattern
  • Explore one-to-many relations between instances with the observer pattern
  • Discover how to route vehicle messages by using the visitor pattern
  • Utilize and control vehicle resources with the thread-pool pattern
  • Understand the penalties caused by anti-patterns in software design

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 03, 2023
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781804614679
Category :
Languages :

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Feb 03, 2023
Length: 266 pages
Edition : 1st
Language : English
ISBN-13 : 9781804614679
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£9.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
£99.99 billed annually
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
£139.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 6,500+ 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 £ 105.97
50 Algorithms Every Programmer Should Know
£37.99
Practical Design Patterns for Java Developers
£31.99
Test-Driven Development with Java
£35.99
Total £ 105.97 Stars icon
Visually different images

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7
(20 Ratings)
5 star 90%
4 star 0%
3 star 0%
2 star 5%
1 star 5%
Filter icon Filter
Top Reviews

Filter reviews by




Maryna Savchenko May 17, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It is remarkable book with clear explanations of design patterns and many useful examples including references to JDK.One of the standout features is chapter about concurrency design patterns, which helps to understand Java concurrency functionality better.I also appreciated the author's attention to best practices and common anti-patterns.Overall it is easy to read, cohesive guide to design patterns from the latest Java version prospective.
Amazon Verified review Amazon
Jeanne Boyarsky Mar 18, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Early in my career, I read “Design Patterns: Elements of Reusable Object-Oriented Software.” This book is often known as GoF (Gang of Four) after the four authors: Gamma, Helm, Johnson, and Vlissides). This was an excellent book and I referenced it heavily. The patterns are still useful to this day. This book was published in 1994. (Soon we can wish it a happy 30th birthday!). In a fun coincidence, GoF is about the same age as Java.“Practical Design patterns for Java Developers” breaks up the design patterns into the same groups – creational, structural, and behavioral. It adds examples of the features from the JDK itself which is great for linking it to things many Java developers have experienced.It also adds examples of implementing the pattern using modern Java. (Java 17 which was the most recent long term release at the time of the book's presenting.) These new features are used heavily making the book good examples of how to use the language.Given that almost 30 years have past, there are more key patterns now. This book covers all the GoF creational patterns and adds object pool, lazy initialization, and dependency injection. For structural, the book adds the filter, front-controller, marker, module, and twin patterns. For behavioral, the book adds the caching, null object and pipeline patterns.The book also covers concurrency patterns and anti-patterns which weren't in GoF. And all that is parts 2 and 3 of the book. Part 1 of the book, gets everyone on the same page. It covers the OOP (object oriented programming), APIE (abstraction, polymorphism, inheritance, and encapsulation) and SOLID (Single responsibility, open-closed, liskov substitution, interface segregation and dependency inversion) terminology in addition to how the JDK is structured.All chapters except anti patterns end with review questions (and an appendix with answers) to solidify the information. In addition to the patterns material, I particularly liked the memory graphs in the anti pattern chapter. If you bought a printed book, you get a PDF and color diagrams free. (I didn't try this as a got a review copy). The code is also available on GitHub including the commands to run each example.You do need to be comfortable reading Java to make sense of this book. If you aren't there yet, grab another book first and come back to this one. If you are comfortable reading Java, this book is for you!I received a complementary copy from the publisher in exchange for writing this review.
Amazon Verified review Amazon
Rachel E. Barnes Jun 20, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I took a design patterns class in college years ago and I was looking for an updated book to refresh myself, this was exactly what I was looking for.
Amazon Verified review Amazon
Marcus Lagergren Mar 27, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Miroslav Wengner, the author of this book, has been an active member of the Java community since he worked at Sun Microsystems, back in another age. He has frequently contributed his knowledge, and has impressively had a prolific output of useful material and articles throughout his career since then.I should disclose here already, that I know Miro well, and he is a fellow Java Champion, so this may not be a completely unbiased review. But I still stand beside my positive feedback here. If in doubt - do verify what I say about this book yourself, or check with someone who has the equivalent level of knowledge. Personally, I feel that my observation that Miro's writing, while coming from deeply technical level, should be accessable to almost everyone with a little bit of experience in Java programming and object oriented paradigms.The book is not the first of its kind in the Java space, but it's probably the first that I have seen with the specific details provided as elegantly as way Miro does it. Miro doesn't just talk about design patterns and best practices, and what has happened to the Java platform through its history. I can also tell from the way he has written the book, that the design patterns he has chosen to write about are based on his impressive vertical knowledge too, from Java applications, and all the way down to the bare metal.Another observation that I have made over the years in various tech leadership positions over Java technology stacks, is that many senior Java developers with great domain knowledge of all the complex dependencies and libraries involved building modern software, still has untapped potential if he or she doesn't understand how the runtime(in this case the JVM and OS) executes their code, and how the CPU actually works (concepts like page faults, cache misses, memory bandwidth, and so on). This does not mean that a good Java programmer needs to explicitly do things that break the abstraction layers towards the native part of the platform - or usually hack about with these kinds of details. That is also very much not something that isn't recommended. There are typically several "nice" ways to get performance and scalability. But understanding at some coarse grained level of detail how the black box that is the JVM will execute your code, will still turn you into a massively better high level programmer. This, without you having the knowledge to build your own JVM and step your way through the garbage collection process with a debugger, or anything of that sort. I strongly believe this is a valid observation.What makes Miro's book stick out when it comes to this, is that I can tell that he has chosen to elaborate on design patterns that are best-practice on the high level side, but also tend to translate well into efficient code running on the JVM. The author is not necessarily explicit about this, in fact, I believe he has deliberately chosen not to be. But I can still infer much from his various pedagogic explanations. This is great, IMHO. I think it is very hard to promote certain practices that a person with good vertical knowledge has, when it comes to diving into complicated explanations of exactly what is going on under the hood for every use case. Adding lots of detail here, wouldn’t necessarily do any harm to the reader. In some cases, like the great "Optimizing Java" by Evans, Newland et al, this is the actual message the book tries to convey. In this case, though, I believe it would have significiantly reduced Miro's audience and the amount of good this book will do, where he do go into implemenation detais. However, the way he picked the design patterns to go over, and the way he explains them, are a great source of nderstanding for engineers who want to improve themselves and that strive to reach the lead software architect level. And this is the right end to start - not prying apart a lot of black boxes to look in side, but rather evangelize on best practice ways to do something in a high level language like Java, that will also bring the benefit of more efficient and less resource hungry programs.The book is made out of several main sections, first a summary of design patterns (general) and a bit about the Java platform and its functionality. The main part of the book follows next, which shows how design patterns should ideally be implemented in Java, and the relevant portions of the JDK libraries that should be used. The final part of the book talks about other essential patterns and anti-patterns. The anti-patterns are the most interesting topic here, IMHO, because typically they are not described in any detail in most literature.The book talks about how certain anti-patterns are bad design, create technical debt and so on, but also has good examples of how seemingly clean code will, in reality, stretch the intended JVM limits, and without the user understanding it, put unnecessary performancedegradations or scalability limits in the system. I really wish there were more of these kind of articles, because this ties directly into my observation that if you do know the vertical of the platform, without actually breaking any abstraction layers or anything. You should still be aware of things like autoboxing overhead in Java, and that the JVM can't magically detect and deduplicate equal Strings on the heap, without extra analysis overhead (typically deduplication as a function of GC) and so on. I think that a great topic for an expansion on this book would be good patterns and anti-patterns when it comes to interference in the JVM. There are not only things to be avoided that a good high level programmer should know, there are also things that are done as premature optimizations but do not alwaysmatter for performance. This section serves as a really good starting point to continue learning about how the Java program interacts with the platform, and should be a good primer for any developer who, before reading Miro's book, may have felt slightly nervous about delving into something heavier, more specialized on-the-JVM behavior, and more low level - e.g. the excellent "Optimizing Java" by Evans, et al.Finally - to summarize - Miro's book is fairly short, consise and to the point. And still it manages to present and explain common best practices used by pretty much any senior engineer in the Java ecosystem to anyone. I think this is quite valuable. It might evenhade been easier to write a thick detailed book, going depth first all the way down to the silicon, describing every detail of what makes a design pattern effective (and not just good abstraction).The way the book balances the width and depth of the material, and that it has still obviously been carefully written to promote patterns that are healthy both for general high level programming, but also gives you efficient implementations when they are running on the JVM, OS aand Silicon, is well thought through. The author also stays far away from the other common failure of a short technical book, which is not really expanding the reader's knowledge much, or even worse, just makes various "dangerous" buzzwords stick in the reader's mind ("blockchain" anymone?)I definitely recommend this book to anyone who wants to be a better Java architect, or for any Java architect already there, who wants to validate (and possibly expand) his or her knowledge. I am impressed by the outline, the material chosen, and the order and the way it is presented. This is really well done!
Amazon Verified review Amazon
S. E. Ritter Aug 03, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Developers need to master multiple skills to become successful. If you plan to work as part of a team, one of those skills will be design patterns. Patterns give us a concise way to express complex concepts that recur frequently in software development. For example, if you say that this part of the design will require a singleton, your team members will immediately understand that you only want a single instance of an object (and the complexities of guaranteeing that, especially in a multi-threaded application).The definitive book on patterns, written by the so-called Gang of Four, has been around for nearly thirty years. However, this is written in an abstract form without demonstrating the patterns used with a specific programming language.Miroslav Wenger’s book has taken a comprehensive approach to patterns targeted at the millions of developers using Java as their language of choice. Thirty-four core patterns are divided into creational, structural and behavioural. For each, a clear description and the motivation for use and sample Java code are provided. The book's second half looks at a further eight patterns targeted at concurrent applications and an equally important discussion of anti-patterns or things to avoid.If you’re a Java programmer looking to understand how patterns can be applied to your code, this book is for you.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.