Skip to content

Commit 94c3d33

Browse files
committed
typo fixed
1 parent c6dfe56 commit 94c3d33

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ Design Patterns are very popular among software developers. A design pattern is
44
common software problem.
55

66
Some of benefits of using design patterns are :
7-
* Design patterns are already defined and provides industry standard approach to solve reccuring problem,
8-
so it saves time if we senibly use the design pattern .
9-
* Using design pattern promotes reusability that leads to more robust and hightly maintenable code.
10-
* Since design patterns are already defined, it makes out code easy to understand and debug. It lead to faster developement and new members of team understand it easily.
7+
* Design patterns are already defined and provides industry standard approach to solve recurring problem,
8+
so it saves time if we use the design pattern .
9+
* Using design pattern promotes re-usability that leads to more robust and highly maintainable code.
10+
* Since design patterns are already defined, it makes out code easy to understand and debug. It lead to faster development and new members of team understand it easily.
1111

1212

1313
__What is a Design Pattern ?__
1414
> A software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design --- Wikipedia
1515
16-
__Java Design Patterns__ are divived into tree parts : *Creational*, *Structural* and *Behavioral*.
16+
__Java Design Patterns__ are divided into tree parts : *Creational*, *Structural* and *Behavioral*.
1717

1818
## CREATIONAL DESIGN PATTERNS
1919

20-
Creational design pattens provide solution to instatiate an object in the best possible way for specific situations.
20+
Creational design pattens provide solution to instantiate an object in the best possible way for specific situations.
2121
The basic form of object creation could result in design problems or add unwanted complexity to the design. Creational design patterns solve this problem by __controlling the object creation__ by different ways.
2222
There are five creational design patterns that we will discuss on :
2323

@@ -28,11 +28,11 @@ __Java Design Patterns__ are divived into tree parts : *Creational*, *Structural
2828
* Prototype Pattern
2929

3030
### Pattern Singleton
31-
31+
3232
Pattern Singleton: > One Class, one Instance.
3333

3434
Singleton is one of the Gangs of Four Design patterns and comes in the Creational Design Pattern category.
35-
Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. The singleton class must provide a global access point to get the instance of the class. Singleton pattern is used for logging, driver objects, caching and thread pool. Singleton design pattern is also used in other design patterns like __Abstract Factory__, __Builder__, __Prototype__, __Facade__ etc. Singleton design pattern is used in core java classes also, for example __java.lang.Runtime__ , __java.awt.Desktop__.
35+
Singleton pattern restricts the instantiation of a class and ensures that only one instance of the class exists in the Java virtual machine. The singleton class must provide a global access point to get the instance of the class. Singleton pattern is used for logging, driver objects, caching and thread pool. Singleton design pattern is also used in other design patterns like __Abstract Factory__, __Builder__, __Prototype__, __Facade__ etc. Singleton design pattern is used in core Java classes also, for example __java.lang.Runtime__ , __java.awt.Desktop__.
3636

3737
To implement Singleton pattern, there are really many approaches but all of them have following common concepts:
3838

@@ -63,9 +63,9 @@ We'll implement the thread safe one here. Classes are in the package `com.single
6363
```
6464
### Pattern Factory
6565

66-
Factory design pattern is used when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class. This pattern take out the responsibility of instantiation of a class from client program to the factory class. Let’s first learn how to implement factory pattern in java and then we will learn its benefits and we will see its usage in JDK.
66+
Factory design pattern is used when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class. This pattern take out the responsibility of instantiation of a class from client program to the factory class. Let’s first learn how to implement factory pattern in Java and then we will learn its benefits and we will see its usage in JDK.
6767

68-
* Super Class : Super class in factory pattern can be an interface, abstract class or a normaljava class. For our example, we have super class as abstract class with overridden toString() method for testing purpose.
68+
* Super Class : Super class in factory pattern can be an interface, abstract class or a normal Java class. For our example, we have super class as abstract class with overridden toString() method for testing purpose.
6969
see `com.factory`.
7070
* sub-classes: Let’s say we have two sub-classes PC and Server with implementation in `com.factory`
7171

@@ -95,12 +95,12 @@ Now let's write the test class.
9595
```
9696
This pattern provides some advantages such as :
9797

98-
* It provides approach to code for the interface rathan than the implementation.
98+
* It provides approach to code for the interface rather than the implementation.
9999
* It removes the instantiation of the actual implementation classes from client code, making it more robust.
100100
* It provides abstraction between implementation and client classes through inheritance.
101101

102102
As examples of its implementation in JDK we have :
103-
103+
104104
* *java.util.Calendar*, *ResourceBundle()* and *NumberFormat getInstance()*;
105105
* *valueOf()* method in wrapper classes like Boolean , Integer etc.
106106

@@ -150,7 +150,7 @@ There are really various implementations of this pattern in JDK : java.lang.Stri
150150

151151
### Pattern Prototype
152152

153-
Prototype pattern is one of the Creational Design pattern, so it provides a mechanism of object creation. Prototype pattern is used when the Object creation is a costly affair and requires a lot of time and resources and you have a similar object already existing. So this pattern provides a mechanism to copy the original object to a new object and then modify it according to our needs. This pattern uses java cloning to copy the object.
153+
Prototype pattern is one of the Creational Design pattern, so it provides a mechanism of object creation. Prototype pattern is used when the Object creation is a costly affair and requires a lot of time and resources and you have a similar object already existing. So this pattern provides a mechanism to copy the original object to a new object and then modify it according to our needs. This pattern uses Java cloning to copy the object.
154154

155155
```java
156156

0 commit comments

Comments
 (0)