前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Architecture : Describable Command and Identifiable Data

Architecture : Describable Command and Identifiable Data

作者头像
绿巨人
发布2018-05-16 18:03:55
5110
发布2018-05-16 18:03:55
举报
文章被收录于专栏:绿巨人专栏绿巨人专栏

Architecture : Describable Command and Identifiable Data

Description

Terms

  • Command A command is a function in a system. Every command has input data and output data, and the system is able to know the schema of every command input data.
  • Describable Commands That means:
    • System know what commands the system has.
    • Commands are describable, the system know the format of input data of a command, and data format returned by the command.
  • Identifiable Data Every field in an input data or an output data is identifiable. For example, in a system, there are departments and employee. Data employee has a field department id which references an id of a department data. Even the department id and employee id are an integers, i.e their data type are same, but the system understand:
    • department id is different with employee id.
    • department id in the employee data is same thing of the department id in the department.

How is the system running

  • Main page We can image the main page like a search page, there is only an text input field provided.
    • Users can find all commands by input "*".
    • Users can input some key words to narrow down candidate commands,
    • At end, the user finds a specific command.
  • Command pages When a command is selected, the system will enter a new page denoted as a command page.
    • First system will get the schema information of input data of the command, and display some fields to get the user to input command arguments.
    • The user input these argument and select execute
    • The system will invoke the command, and display the return data
  • Command perception for return data When the system get an return data, the system can find corresponding commands. For example: The system get a list of employee by invoking GetEmployee command, then system knows DeleteEmployee command should present because the DeleteEmployee command's input is an employee id which is provided in the employee list.
  • Command perception for input data If the GetEmployee command accept an department name as input to query, the system understands the GetDepartment command can help to input the field of department name as the GetDepartment returns department name.

Implementation considerations

  • Use infer For example: var employeeId is an employee id. the name of parameter, field and property will help the system to infer the meaning.
  • Use inheritance for different fields with same data type, especially id For example, we define a class id, and classes DepartmentId and EmployeeId will inherits the class Id. Id |-- DepartmentId |-- EmployeeId
  • Use annotation for mark field's identity
本文参与?腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-10-07 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客?前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与?腾讯云自媒体分享计划? ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Architecture : Describable Command and Identifiable Data
    • Description
      • Terms
      • How is the system running
    • Implementation considerations
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
    http://www.vxiaotou.com