※Category
□Entity
○ Attributes
○ □Set attributes
◇ Contact
■ Entity instance (word)
● Attribute instance
● ■ Set attribute instances
◆ Contact instance
// Or /*...... */Comment
ProgramThe document consists of three parts:
1. Physical Contact architecture-directory outline
2. entity instances and contact rules-narrative methods and elements
3. Application Process ---- equivalentArticleORGANIZATION FORM
///////////////////////////Entity contact Architecture//////////////////////////
// Rectangular object definition
□Rectangle
○ Long
○ Width
○ □Area
// Set attribute Definition
○ □Area
○ Long
○ Width
◇ Multiplication
// Rectangle object definition Specialization
□Rectangle □expanded rectangle
○ □Side Length
// Set attribute Definition
○ □Side Length
○ Long
○ Width
◇ Jia
◇ Multiplication
○ 2
// Output definition
□Output Interface
○ Print
/////////////////////////////////Entity instances and contact rules/////////////////////////////////
◇ Multiply ◆ */length/width *
◇ Add ◆ +/long width + // It can also be instantiated into the following two forms: ◇ add ◆ Add/A + B or ◇ add ◆ and/a B +
□Rectangle ○ □area ■ my rectangle area// Indicates that "my rectangle area" is an entity.
○ Long
□Expanded rectangle ○ □side length ■ my rectangle ●■ side length// Represents an Object Property
□Output interface ○ printing ■ screen ● Printing
/// // Application process ///// /////////////////////
// Program input 1
■ screen ● Print \ □output interface ○ print
■ my rectangle area \ □rectangle ○ □area
● 10 ● 5 ◆ * // This is a short sentence consisting of attribute words and contact words, some rules defined by the instance are processed in the following order:
/*
● 10 \ 10
● 5 \ 5, 10
◆ 50
*/
// program input 2
// long sentence format that can also be written
■ screen ● print ■ my rectangular area ● 10 ● 5 ◆ *
// Program input 3
// The following is a form of writing entity instances, contact rules, and application processes together.
//The instance and contact rule are extracted from the following text.
□Output interface ○ print ■ screen ● print □rectangle ○ □area ■ my rectangle area is long ● 10 ○ width ● 5 ◇ multiply ◆ ** ○
□Extended rectangle ○ □side length ■ my rectangle ● ■ side length ○ width ● 5 ◇ add ◆ add ○ 2 ● 2 ◇ multiply ◆ *
// Program input 4
// Using the E-R model "generalization" principle, the physical connection architecture, can not be separately listed. This document contains all the content of the program organization.
// Entity contact architecture andInstances and contact rules are independent from the following programs.
■ Screen ● print□Output interface ○ print ■ my rectangle area □rectangle ○ □area ● 10 ○ length ● 5 ○ width ◆ * ◇ Multiplication
■ My rectangle ● ■ side length □expanded rectangle ○ □side length ● length ○ length ● 5 ○ width ◆ sum ◇ + ● 2 ○ 2◆ * ◇ Multiplication
// Input Method of the program:
// Which input should we take if there are so many program input forms above? In fact, we can use the program input 2 method. Entity contact architecture andThe instance and contact rules adopt a similar input method. Dynamically create and define in a separate form.
// For example:
■ screen ● Print ■ my rectangular area ● 10 ● 5 ◆ *
^ [ □output interface ○ print] / span>
// another example is:
■ screen ● print ■ my rectangular area ● 10 ● 5 ◆ *
^ [ ◇ multiplication/○ length, ○ width ] // "/○ length, ○ width "indicates the contact instance of the interpreter. ◆ * processing elements and sequence.
// Conjecture
// The Interpreter first looks for the "Contact word" at the rightmost of the long sentence"◆ *Find the attribute word instance on the left.
// The Dictionary defined by the forth language can be regarded as a specific instance that defines some atomic entities and links. To achieve E-R-oriented programming, you also need to increase the entity-linked architecture andInstance and contact rules
// This article only provides a simple instance of conjecture and prototype of the "entity contact (E-R) model, there may be many incorrect places.