GithubHelp home page GithubHelp logo

refactoring-movie-rental's Introduction

Refactor Movie Rental

开发环境

  • JDK1.8+

业务需求

2013年初,袁Sir在长安大学东门口租了一个小摊位,经营出租碟片。经过半年的苦干,回头客慢慢多了起来。他想将这些顾客的信息管理起来,为他们建立会员积分系统,通过系统推出一些会员回馈福利,建立更好的用户粘性。他寻思着找家私人软件开发外包花点小钱做个系统,这个系统可以在顾客租碟片的时候能够出一个票据信息,格式如下:

Rental Record for 老王:
    同桌的你  3.0
    宠爱  15.0
    战狼2  8.0
Amount owed is 26.0
You earned 4 frequent renter points

他目前经营的碟片主要有三种类型,每种类型的影片对应常客积分和租金也不一样,具体如下:

  1. 新片
    • 收费标准:每天3元
    • 常客积分:每次积1分,若租期大于1天多积1分
  2. 历史片
    • 收费标准:前2天一共2元,超过两天,每天1.5元
    • 常客积分:每次积1分
  3. 校园生活片
    • 收费标准:前3天一共1.5元,超过3天,每天1.5元
    • 常客积分:每次积1分

经过2周的开发,袁Sir拿到系统,但是用了一周,系统很不稳定,没办法,不愿意花钱做的系统就是不太好用啊。他此时也有想法给系统添加点新功能,于是他这次想多花点钱雇个高手来开发(还是雇不起公司~ ~)。

机缘巧合,袁Sir通过朋友找到了你。作为一名有追求的程序员,你拿到这个系统,看到神一般的命名、谜一般的逻辑,在开发新功能之前,你需要好好重构这个代码。

refactoring-movie-rental's People

Contributors

yuanshenjian 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.