Skip to content

tytydraco/CS3560-Assignment-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS3560-Assignment-2

A Java project that explores object-oriented patterns.

Patterns

Overview

  • Visitor: Objects can visit other objects and perform operations.
  • Observer: Objects can "watch" other objects for changes, and react when they change.
  • Singleton: An object that can only have one instance of itself ever be created.
  • Composite: An object has a tree of subobjects of the same type.

Usage

  • Visitor: I chose to make the Tweets visitable, and created a goodness visitor and a length-validator visitor.
  • Observer: I allowed user feeds to be observed, so that when users posted a new tweet, any open windows would know to fetch the new posts.
  • Singleton: I heard that it was bad practice to use Singletons because they are nearly the same as global variables, but I used it to hold the root group since there would only ever be one allowed to exist during the program's lifespan. I also included methods for the root group here as well.
  • Composite: The groups and users are compositable, meaning that groups can contain a tree of subgroups and users. The data manager is able to traverse the composite structure. The Identifiable class is the component class, and the composite class is the Group and User.

About

A Java project that explores object-oriented patterns.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages