Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java Design Patterns Tutorial | Edureka

137 views

Published on

YouTube Link: https://youtu.be/C_oPLDaSy-8
**Java, J2EE & SOA Certification Training - https://www.edureka.co/java-j2ee-training-course **
This Edureka PPT on "design patterns in java" will provide you with detailed knowledge about Java Design Patterns and along with it, This PPT will also cover some real-time examples of some important Design Patterns in Java, in order to provide you with a deep understanding about their functionality. This PPT will cover the following topics:

Why do we need Design Patterns?
What are Design Patterns?
Structure of a Design Pattern
Types of Design Patterns
Creational Design Pattern
Structural Design Pattern
Behavioural Design Pattern
JEE Design Pattern
Overview of design patterns

Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Java Design Patterns Tutorial | Edureka

  1. 1. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  2. 2. www.edureka.co TYPES OF DESIGN PATTERNS STRUCTURE OF DESIGN PATTERNS WHAT ARE DESIGN PATTERNS? WHY DO WE NEED DESIGN PATTERNS IN JAVA? OVERVIEW OF DESIGN PATTERNS
  3. 3. WHY DO WE NEED DESIGN PATTERNS? www.edureka.co
  4. 4. WHY DO WE NEED DESIGN PATTERNS? www.edureka.co OOP solutions Easy to Maintain Efficient
  5. 5. WHAT ARE DESIGN PATTERNS? www.edureka.co
  6. 6. WHAT ARE DESIGN PATTERNS? Software Design Pattern can be defined as a software template or a description to solve a problem that occurs in multiple instances while designing a Software Application or a Software Framework. DESIGNPATTERN www.edureka.co
  7. 7. STRUCTURE OF DESIGN PATTERNS www.edureka.co
  8. 8. STRUCTURE OF DESIGN PATTERNS Structure of Design Patterns can be described as a graphical representation of the classes involved in the pattern following the notations of Object Modeling Technique (OMT). Term Description Pattern Name Describes the essence of the pattern in a short, but expressive name. Intent Describes what the Pattern Does Also, known as List any synonyms of the pattern Motivation Provides an example of the problem and describes the solution to it Applicability Lists the situations where the pattern is applicable Structure Set of diagrams of the classes and objects that depict the pattern Participants Describes the classes and objects that participate in the design Collaborations Describes the Participants collaboration and their responsibilities. Consequences Describes the forces that exist with the pattern and the benefits www.edureka.co
  9. 9. TYPES OF DESIGN PATTERNS www.edureka.co
  10. 10. TYPES OF DESIGN PATTERNS Creational Design Patterns Structural Design Patterns Behavioral Design Patterns JEE Design Patterns www.edureka.co
  11. 11. Creational Design Patterns Creational Design Patterns are concerned with the method of creating Objects. The Creational Design Patterns are classified as follows: • Factory Design Pattern • Abstract Factory Pattern • Singleton Pattern • Prototype Pattern • Builder Pattern. • Object Pool Pattern www.edureka.co
  12. 12. CREATIONAL DESIGN PATTERNS Factory Design Pattern Factory Design Pattern: It follows the principle of “Define an interface or abstract class for creating an object but let the subclasses decide which class to instantiate“. The Factory Method Pattern is also known as Virtual Constructor. www.edureka.co
  13. 13. CREATIONAL DESIGN PATTERNS Factory Design Pattern Example Example: We have three Cellular Network Plan which describes the call cost per minute. Here we have three different networks namely, abcNetwork, pqrNetwork, and xyzNetwork along with their charges per minute. Let us find out the cost of a certain number of minutes on each network. www.edureka.co
  14. 14. CREATIONAL DESIGN PATTERNS Singleton Design Pattern Singleton Design Pattern: It follows “define a class that has only one instance and provides a global point of access to it“. The class must ensure that only a single instance should be created, and a single object can be used by all other classes. www.edureka.co
  15. 15. CREATIONAL DESIGN PATTERNS Singleton Design Pattern Example www.edureka.co Example: We have a MySQL Database. Let us insert data into the database using one single object instance. Here, we have 4 different operations that are performed onto the database and all of those operations use one single object instance.
  16. 16. Structural Design Patterns Structural Design Patterns deal with the composition of classes and objects which form larger structures. The Structural Design Patterns are further classified as follows: • Facade Pattern • Bridge Pattern • Composite Pattern • Decorator Pattern • Adapter Pattern • Flyweight Pattern • Proxy Pattern • Filter Pattern www.edureka.co
  17. 17. STRUCTURAL DESIGN PATTERNS Facade Design Pattern Facade Design Pattern: Describes a higher-level interface that makes the subsystem easier to use. Every Abstract Factory is a Facade Design Pattern. It protects the end-users from the complex sub-system components. www.edureka.co
  18. 18. STRUCTURAL DESIGN PATTERNS Facade Design Pattern Example www.edureka.co Example: Now, let us use the Facade Design pattern to find out the cost of the franchise you wish to buy.
  19. 19. STRUCTURAL DESIGN PATTERNS Adapter Design Pattern Adapter Design Pattern: Provides the interface according to client requirement while using the services of a class with a different interface. The Adapter Pattern is also known as Wrapper. It is designed to enable two or more previously incompatible objects to interact with each other. www.edureka.co
  20. 20. STRUCTURAL DESIGN PATTERNS Adapter Design Pattern Example www.edureka.co Example: Here is a simple Library Card example which is designed to issue a Library card to a new user of the library which includes all the details like a book holder ID, Account number and many more. Let us execute this using Adapter Design Pattern.
  21. 21. Behavioural Design Patterns Behavior Design Patterns are concerned with the responsibility and interaction between the objects. The Behavioural Design Patterns are further classified as follows: • Strategy Pattern • Iterator Pattern • Mediator Pattern • Command Pattern • State Pattern • Observer Pattern • Template Pattern • Visitor Pattern www.edureka.co
  22. 22. BEHAVIOURAL DESIGN PATTERNS Strategy Design Pattern Strategy Design Pattern: It defines a family of functionality and encapsulates each one and make them interchangeable. The Strategy Pattern is also known as Policy. www.edureka.co
  23. 23. BEHAVIOURAL DESIGN PATTERNS Strategy Design Pattern Example www.edureka.co Example: we are going to consider a simple example of a calculator. We need to perform five different operations. We shall encapsulate all those five operations into Calculator class and execute the program using the Strategy Design Pattern.
  24. 24. BEHAVIOURAL DESIGN PATTERNS Command Design Pattern Command Design Pattern: It encapsulates a request under an object as a command and passes it to the invoker object. Invoker object looks for the appropriate object which can handle this command and pass the command to the corresponding object and that object executes the command. It is also known as Action or Transaction. www.edureka.co
  25. 25. BEHAVIOURAL DESIGN PATTERNS Command Design Pattern Example www.edureka.co Example: This example demonstrates a simple command execution cycle where the user requires to exhibit switching on and off the various electronic devices in his houses like a bulb and stereo player. He invokes the command through an invoker object called a simple remote control.
  26. 26. BEHAVIOURAL DESIGN PATTERNS Observer Design Pattern Observer Design Pattern: It defines a one-to-one dependency so that when one object changes state, all its dependents are notified and updated automatically. www.edureka.co
  27. 27. BEHAVIOURAL DESIGN PATTERNS Observer Design Pattern Example www.edureka.co Example: We are going to execute a program using the Observer Design Pattern to display the current average score and the current predictable score of a cricket match.
  28. 28. JEE Design Patterns JEE Design Patterns are concerned with providing solutions to the Java EE-based software applications and frameworks. The JEE Design Patterns are further classified as follows: • MVC Design Pattern • Dependency Injection Pattern • DAO Design Pattern • Business Delegate Pattern • Intercepting Filter Pattern • Service Locator Pattern • Transfer Object Pattern www.edureka.co
  29. 29. JEE DESIGN PATTERNS MVC Design Pattern MVC Design Pattern: MVC Design Pattern is defined as follows: • Models are basically objects used as blueprints for all of the objects that will be used in the application. • Views are used to represent the presentational aspect of the information and data located in the models. • Controllers control and act as both of the Models as well as Views. They serve as a connection between the Models and Views. www.edureka.co
  30. 30. JEE DESIGN PATTERNS MVC Design Pattern Example www.edureka.co Example: We are going to use MVC Design Pattern to set and print the data of the school students.
  31. 31. JEE DESIGN PATTERNS DAO Design Pattern DAO Design Pattern: DAO is a pattern in which objects are dedicated to the communication with the Data Layer. These objects instantiate “Session Factories” and handle all of the logic behind communicating with the database. www.edureka.co
  32. 32. JEE DESIGN PATTERNS DAO Design Pattern Example www.edureka.co Example: We are going display the Developer details of a certain IT company using the DAO Design Pattern.
  33. 33. OVERVIEW OF DESIGN PATTERNS
  34. 34. www.edureka.co OVERVIEW OF DESIGN PATTERNS • They are designed to be reusable in multiple projects. • Their solutions help to define system architecture with ease. • Design Patterns can capture the software engineering experiences. • They provide transparency to the design of an application. • Design Patterns are well-proven solutions given by Experts. • Java Design Patterns provide clarity to the System Architecture • They provide the possibility of building a better system. www.edureka.co
  35. 35. Copyright © 2017, edureka and/or its affiliates. All rights reserved.
  36. 36. www.edureka.co

×