System Designer

System Designer

  • Languages icon繁體中文
    • English
    • Ελληνικά
    • Português (Brasil)
    • Svenska
    • Help Translate
  • SUPPORT
  • GITHUB

›Guides

Introduction

  • What is System Designer?
  • What is Design First?
  • Quick Start
  • Quick Start in videos

Guides

  • Installation
  • Create a System
  • 創建一個模式
  • Edit a model
  • Create a Behavior
  • Create a Type
  • Create a Component
  • Run your System
  • Export a System
  • Import a System
  • Generate a diagram
  • Sync your systems with GitHub
  • Design a remote client system
  • Design a remote server system
  • Manage Extensions
  • Extend System Designer
  • Shortcuts

Tutorials

  • List of Examples
  • Bundle your CSS
  • Bundle your JavaScript
  • Bundle your HTML
  • Test a server-side application
  • Create a NPM module
  • Create a website
  • Listen to a model event
  • Listen to a data store event
  • Send messages
  • Send messages to other systems
  • Create an extension
  • Generate a model from a JSON file
  • Create a Graph system

Articles

  • 關於這個開源方案

About

  • Who is behind System Designer?
  • Privacy Policy
  • License
Translate

創建一個模式

一個模式可以幫助你定義一個模型。 用相當單純的情報,就可以由模式產生一個模型。 然後你就可以開始編纂一個模型。

Create a schema

在 System Designer 上創建模式

  • 點擊Schemas 頁,
  • click on the '+' button on the left toolbar,
  • 輸入你要創建的模式名稱
  • then click on Create button,
  • 一個新的模式就此創建完畢。你將可以看到它出現在Schema 一覽中:

Image Alt

Edit a schema

  • 點擊你所創建完的模式,
  • 編輯器會切換至模式詳情編輯頁,
  • you can now edit the configuration of the schema:

Image Alt

  • 點擊回到Schemas 頁,
  • 設定已經成功更新。

Image Alt

What is a configuration?

A configuration is an object in which you declare the property / link / collection / method / event of the model.

In the configuration object you have by default these properties:

  • _id : string, unique id of your schema.
  • _name : string, name of your schema.

Define inheritance

To add inheritance between your schemas you need to add the _inherit property. This property is an array in which you put all the schema names that this schema must inherit.

{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "_inherit": ["Person"]
}

In this example Jedi schema inherits from Person.

Define a property

To define a property add a key that has got a property value.

{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "name": "property"
}

In this example Jedi has a name property.

Define a link

To define a link between models, add a key that has got a link value. A link is a 1-1 link between models.

{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "father": "link"
}

In this example Jedi has a father link.

Define a collection

To define a collection add a key that has got a collection value. A collection can be:

  • a collection of typed objects (example: adresse, ...) or
  • a collection of components (i.e. like a 1-N link between models).
{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "children": "collection"
}

In this example Jedi has a children collection.

Define a method

To define a method add a key that has got a method value.

{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "fullName": "method"
}

In this example we have defined a fullName method for Jedi.

Important note on renaming

If you rename an existing method, it will delete the method and create a new one. So any code related to the previous method will be deleted.

Define an event

To define an event add a key that has got an event value. An event is a asynchronous method.

{
  "_id": "ee8b5c97-cb89-4cdf-82b3-d9d8bea23ac5",
  "_name": "Jedi",
  "statusChanged": "event"
}

In this example we have defined a statusChanged event for Jedi.

想知道更多?

For more information on schemas, go to the System Runtime documentation.

← Create a SystemEdit a model →
  • Create a schema
  • Edit a schema
  • What is a configuration?
  • Define inheritance
  • Define a property
  • Define a link
  • Define a collection
  • Define a method
  • Define an event
System Designer is distributed under Apache License 2.0 - Copyright © 2024 Erwan Carriou