Skip to content

fatih-yavuz/java-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns

Abstract Factory

Display price of the laptop parts (CPU and RAM) based on manufacturer (Dell,
IBM, and HP) and usage (Home, Business, and Gaming).

Output

Output

Command Pattern

Simulate pressing remote control buttons to move a drone to various angular rotations (0, 90,
180, 270, and 360 degrees). Also, simulate pressing an undo button, to move drone to previous rotation. 

Output

Output

Composite

A Work Breakdown Structure (WBS) that you created in your Software Project Management
Plan (SPMP) is a tree structure and depicts the work to be done and required effort. Each node can be
decomposed further until required effort is understood. Write an application which will print the required
total effort of a software engineering project.

UML Class Diagram

Output

WBS

Image of WBS

Output

Output

Factory Method

Display price of a laptop based on manufacturer (Dell, IBM, and HP) and usage
(Home, Business, and Gaming).

Output

Output

Iterator

CTIS has two separate internship applications. CTIS290 and CTIS310. Both of these
applications keep a student’s name, id, and the company. However, CTIS290 uses an ArrayList, CTIS310
uses Array. CTIS department would like merge these two separate applications

UML Class Diagram

Output

Output

Output

Singleton

Write “Hello World” to a log file. This log file has to be accessed by only one object. This
object should be created with lazy instantiation. Other objects should be able to write to log file only via this
single object.

Strategy

A digital audio player application will play either MP3 or MP4 files, and which decoding
algorithm will be set dynamically during run-time.

UML Class Diagram

Output

Output

Output

Template Method

 An image display application displays either TIFF or JPEG files. First it opens the
file and then loads to memory. Depending on the type of file, an image is processed differently, and can be
enhanced. After an image is processed and optionally enhanced, it can be displayed.

UML Class Diagram

Output

Output

Output

About

Design patterns in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages