GithubHelp home page GithubHelp logo

funny-json-explorer's Introduction

Funny JSON Explorer

软工作业

Funny JSON Explorer设计文档

设计模式:

  • 类图如下:

alt text

  • 文件与模式:
    • data.json中为输入数据,可自行修改
    • icon_family.py文件中为图标族类
      • chess_icon_family.py文件中定义了ChessIconFamily类,继承自IconFamily类
      • star_icon_family.py文件中定义了StarIconFamily类,继承自IconFamily类
    • builder.py文件定义了Builder类,用于构建树形结构,调用Factory,为建造者设计模式
    • different_factory.py文件,定义了三个类,分别为抽象工厂类AbstractFactory以及继承自AbstractFactory的两个类:
      • TreeFactory类,用于创建树类风格对象
      • RectangleFactory类,用于创建矩形风格对象
    • factory.py文件,定义Factory类,用于调用不同风格的工厂类,为工厂设计模式
    • node.py文件,定义了Node类,用于构建树形结构的节点
      • tree_node.py文件,定义了TreeNode类,继承自Node类,用于构建树类风格的节点
      • rectangle_node.py文件,定义了RectangleNode类,继承自Node类,用于构建矩形风格的节点
      • node相关文件使用了组合设计模式
    • main文件

运行结果:

  • 可直接运行main.py文件: alt text

上述内容为四次运行fje的结果:

其中前两种为星星图标族情况下树形风格和矩形风格的结果,可见五芒星和六芒星分别在中间节点和叶子节点前

后两种为国际象棋图标族情况下树形风格和矩形风格的结果,可见填充和镂空象棋分别在中间节点和叶子节点前

参考资料:

funny-json-explorer's People

Contributors

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