Giter Site home page Giter Site logo

snakeladder's Introduction

Overview

The base package is a variant of the Snake and Ladders application. The source code is from the SWEN30006, Software Design and Modeling, the University of Melbourne.

Given the code, the goal is to refactor the code in favor of future development and maintenance. By applying the GRASP principle, the refactored code achieves the goal, and the required implementations verify the theory.

MVC architecture

The refactor strategy follows the model-view-controller (MVC) architecture with GRASP principles. The architecture is favored because it separates concerns within a feature. For instance, the model handles the data according to the controller's request in the game pane feature. The view responds to the data updates and renders the change to the graphical user interface (GUI). The architecture maintains high cohesion and uses pure fabrication, i.e., model, to achieve low coupling. Thus, the first goal was to decouple the data operation from the game pane and navigation pane.

Dependency injection

The idea comes from the source code, where the implementation uses the setter injection, which is one of the dependency injections, to couple two panes. After some research, The dependency pattern is utilized since it strongly lower the dependency between entities or components inside an entity. The dependency injection instantiates the object and constructs the necessary objects together later. The pattern removes the higher-level object's dependency on low-level objects. For example, in the new design, the cup class and die class objects are independent of the navigation pane. However, the cup class can inject the navigation pane by setter injection to access its methods.

Design

The original design model diagram and the domain class diagram are inside the design folder. The new design is also in the folder, with GRASP principles' marked for comparison.

snakeladder's People

Contributors

ruotzhao avatar wodenwang820118 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.