📜 ⬆️ ⬇️

Elements, the basis for the development

Work and development go well when there is:

  1. What makes a start (basis).
  2. What to strive for (idea, project, etc.)

One of the basics I want to share with you in this publication.

image

Elements: theoretical part


An element (object) is a unit: material, abstract or conditional.
')

Containers and objects


The elements are divided into: container (K), container object (KO) and object (O).

image

  1. Container (K) - an element that can contain other elements - container objects (KO) or objects (O). The container itself cannot be inside of anything.
  2. Container Object (KO) is an element that can contain other elements - container objects (KO) and objects (O), and at the same time it can be inside a container object (KO) or container (K).
  3. An object (O) is an element that cannot contain other elements within itself, but can itself be inside a container object (QO) or container (K).

Relativity


Each of the elements can be considered separately:

  1. As a Container, cutting off information about everything inside of which it can be, making it original, in relation to which we will consider everything else. For example: a book, when we take it for a Container, it doesn’t matter that it is in a room or in a closet on a shelf, only it’s important and what’s inside it (sheets, pages, text, chapters, paragraphs, sentences, words , syllables, letters, symbols).

    image
  2. As a container object. Then it is taken into account, and what is inside the element, and what is inside itself.

    image
  3. An object. When we consider an element as O, then we directly go to its type and properties, while not forgetting about the element within which it can be. If we turn to the consideration of the book as an object, then we begin to consider its parameters: length, thickness, width, author, title, etc.
    image

Types and Properties


Each element has its own type.

image

An item type is a specific set of item properties.

You can also say that the element has a list (set) of properties. This list has a name and, saying “element type”, we mean (we mean) the name of this list.

Element properties - describe the element. Conventionally, you can take anything for a property. Element properties are ordinary (basic) and composite, based on the interaction of basic properties or other information including. the interaction of elements.

For example, here is a list of the element properties:

  1. Width
  2. Length
  3. Radius
  4. Circumference
  5. Height
  6. Thickness
  7. Hearing
  8. Vision
  9. Perimeter
  10. Square
  11. Circumference
  12. ...

Each of the element types above has its own set of properties. So, for example, the element type: square, has properties 1, 2, 9, and 10, and type: circle has properties 3, 4, and 11. Properties 10 and 11 are composite properties, so they run separately from each other.

Hearing and vision, although not related to geometric shapes, but if we conditionally took them for the properties of the element, they will be on this list and will be of the type: animal.

Following the trailing properties of magnitude: cm, mm, km, kg, second, minute, hour, Hz, Ohm, etc.

If we consider an element as an Object, then we proceed to consider the properties of this element. If we consider an element as K or KO, then we consider a list of elements that are inside K or KO, if they are there. If inside K or KO there are no elements, it would be appropriate to treat them immediately as an Object.

Interactions


Elements can interact with each other, even though each of them may be in a different branch of the tree (DOM). The interaction between elements and element types occurs within a specific pattern.

image

image

image

Interactions are otherwise called intersections (cross).

Take the two elements E1 and E2. When crossing, E1 and E2 may have some influence on each other:

  1. E1 has an effect on E2.
  2. E2 has an effect on E1.
  3. E1 and E2 have equal or no influence on each other.

If we consider the example with the address given above, then if Ivan Ivanovich is taken as E1, and his apartment is E2, then the first interaction option will suit us, since Ivan Ivanovich can sell his apartment. The apartment does not have an impact on Ivanovich.

And if for E1 we take the Worker, and for E2, the work, then option 3, since The employee works and he gets paid for it, and the employee can be fired from his job or he can quit.
In addition to the influence of the interaction stands out: K, KO and O:

  1. K and K.
  2. K and KO.
  3. K and O.
  4. KO and KO.
  5. KO and O.
  6. O and O.

What is the practical use of all this?


To begin with, each element has its own identifier (ID), knows its parent (parent), has its own type (type), and the order of display inside the parent (sort).

image

If you store this information in the database, the table will look like this:
id (int)parent (int)type (int)sort (int)
oneNullone0
2one20
3230

Actually, element types should have their own reference table:
id (int)title (vchar)name (vchar)
oneTriangletriangle
2A circleCircle
3Squaresquare

Behind the types will pull the list of properties:
id (int)title (vchar)name (vchar)
oneWidthwidth
2Lengthlength
3Heightheight
fourRadiusradius

And lists of type properties (which properties of which type)
type (int)property (int)
3one
32
2four

Table-reference Values ​​(value (id, title, name)), in which property values ​​are measured.

id (int)title (vchar)name (vchar)
onepxpx
2cmsm
3minutemin
foursecondsec


But this is what basics swing. Each property can have its own separate table in which certain data will be stored. For example, the Width table (a table of the size of one of the sides that defines the width).

Records are not assigned to the property, but to the ID of the element whose type has this property.
elementID (int)width (int)valueID (int)
350one

Next come the crossings (cross)
elementID1 (int)elementID2 (int)pattern (int)type (int)effect (int)
one2oneoneone

Pattern - Intersection patterns, table reference.
id (int)title (vchar)name (vchar)
oneAddressaddress

Type - Intersection types (k-ko or ko-o), as well as the usual reference book similar pattern.
Effect - consider the effect of one element on another.

Columns Type and Effect as practice has shown can be omitted. Maybe these columns will come in handy sometime, somewhere ...

The basis of the database is ready.

If we take categories and publications, that is, an element of type “category”, and there is an element of type “publication.” Elements of type “publication” are inside an element of type “Category”. The type “publication” pulls the properties “content”, “images”, “video”, “prices” (if it is a product), etc.

What about you can rush with this basis at hand?


Restructured OKUN List-Directory (All-Russian Classification of Services to the Population)

In this image, the OKUN is considered as a CO. list of items.

image

In this image, one of the Elements (OCUN) is considered as O, i.e. its properties.

image

Additional images for example
image

image

image


A game, or something else. A visual representation of some idea.


Both works have the same basis and database. Only different types and properties of elements, and visually
they are presented in different ways.

Source: https://habr.com/ru/post/448348/


All Articles