Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shaikrasheed99/builder-pattern

Implementation of Builder Pattern.
https://github.com/shaikrasheed99/builder-pattern

builder-pattern design-patterns java tdd tdd-java

Last synced: about 1 month ago
JSON representation

Implementation of Builder Pattern.

Awesome Lists containing this project

README

        

# Builder pattern example using Test Driven Development

## Example (Car):

* There are two different types of cars.
* Normal cars and Electric cars should be created with the builders.
* Electric car builder would create electric car from it.
* Normal car builder would create normal car.
* Since, the state of the car is so long and client cannot remember everything and their order.
* So the client uses these builders to a car from parameters which he remembers.


### code [electric car](https://github.com/shaikrasheed99/builder-pattern/tree/master/src/main/java/com/tw)

### code [normal car](https://github.com/shaikrasheed99/builder-pattern/tree/master/src/main/java/com/tw)


## Class diagram:

![](class-diagrams/builder-pattern.png)