Garo Garabedyan- a private blog

Everything here is written and belongs to me except otherwise noted.

Posts Tagged ‘data flow

Event Based Content Editor

with 4 comments

Event Based Content Editor

(Concrete Implementation of the eventBased Data Philosophy)

Printable version in odt and pdf.

People use the content (in general text) as the main output of their work. I want to provide an ability of storing information about every procedure which the human has done on this output. In such a way that when a procedure binds pieces of text in some relations, this binding to be technologically presented and when a piece of text is edited, the user to be aware (by warning) of the relations of the edited text with other text(s) pieces. I want to ensure not breakable logic relations between pieces of data when future editing is applied.

1. Used expressions and their meanings in this paper:

1.1 Text/ Content

Text refers to every group of words logically forming connected statements. Text in its nature has an object of representation. Valuable content is always dynamic, it changes when there is a change in the purpose of the document, in documents which relate to this one and in many other consequences which reason the need of change of the content.

In technology aspect content is symbols, pictures, tables, etc.

1.2 Content Editor

Content editor generalizes a group of applications which deals with content. These are applications enabling editing of content and this way creating revisions of it.

1.3 Connections between parts of content

In any text we found connections between its parts and parts of other texts. Of its own genesis this connections are dynamic as the nature of the content.

Relations are logical and lexical according to their nature of genesis. When a relation breaks, this causes a logical or lexical mistake.

This logical relations count is not discrete. Often we can’t count them. We as editors of content are taught to capture many of this relations, but some of them are bind with the concrete content and its aim. The letter relations are too heavy and sometimes with a couple of readings aren’t enough to recognize such a broken relation.

1.4 Part of Content/ Text

Text which can be marked in the editor. Copied and pasted in the same or other document.

1.5 Connection between Parts of Text

Group of texts connected in a connection. Minimal count of this group is 1 /one/ (in order to enable user to start some connection and in future to find text appropriate to be added to the connection), maximal count of this group is not set at this moment. Every connection can have text describing the connection, this text is called down as note to the connection. It is possible to not enable the note to the connection to be text (see the definition of text up in this paper) but only group of symbols.

2. Description of the eventBased Content Editor:

2.1 Event Based Text Editor Catching Changes and Its Related Parts in Order to Provide Applying of the Change to the all Related in any Manner Pieces

This is a text editor with a functionality presented to the author(s) to declare connections between parts of the text and write some notes describing the declared connection. Every time when some part of text in this editor is changed and this change affects some part which is part of connection, to the user (in future we can address the output of this functionality not only to human but to a machine) is presented information about the text parts in the connection (which presentation allows the user to see the whole part of text in the connection) and notes written about the connection.

One part of text can be part of many different connections. Every part of text can contain many parts of text which are parts of connections.

The user can view/edit the connections for every part of text by using a viewer integrated in the text editor.

2.2 Advance functionalities

Adding special object treated as part of text which is not printed, but in its own is a macro, which outputs texts and as every part of text this one can attend connections. This objects are supposed to be checked by the editor by running background process in the operating system and when the output of the object (macro) is changed the editor to present a warning message containing the two outputs of the object (present and past) and the parts of the text in the connection(s) and the notes to the connection(s) plus fast way to open the document and edit this parts of text.

The macros have to store in itself the last its output.

Note: It is not an aim of this paper to work on the idea to present the output of the special object (macro) directly to the text of the document.

2.3 Possible implementation

The Event Based Text Editor is written in form of macro and added to the general templates of any Text Editor providing macros. The user is supposed to be provided with a button for accessing the viewer of connections and creating connections tool. Every connection of its own is stored in other macro (one for the all connections in a document) which is not placed in the template but without stored connections in it.

This implementation in its own is multi platform and saves the connections through different computers when they are in the same document.

It is not sure what will happen when part of text (which is part of a connection) is copied and pasted in the same or in other document.

One possible business logic is: Connections are specific in the context of the whole document and it’s not right to automate the connections, but only prompting for this ability at every copying. Argument (in example): it’s possible the user to try to copy part of text which is part of connection which connection has in itself parts of text which are not in the part of copying text. It’s possible this texts to be part of connections with other parts of text not in the copying text.

Q: Connections declared by the user are not in deep about lexical and all connections (in general) but only about the most important ones?

Q: It’s important to keep only the first level of connection?

Example:

<1….1> <2…...2> <3…….3>

As its shown it is possible to be selected parts of parts of connections. It is not a good idea to try to automate the copying of connections in every case.

<1…..<2…..1>….2>

Here is an example showing the specific nature of part of texts, it’s not a good idea to use XML style of presenting the connections, but XML does not allow an element to contain an open tag of a child element without child’s closing tag in the first element, too.

2.4 Possible additional tools

Tool enabling finding differences between two documents by using their connections as a start point. In general searching not for connections changes but for the whole document.

Tool working in background of the operating system and from a list of declared files to take the objects (macros) from them which are part of some connections and trace check for differences of the output.

2.5 Embedded RDF in XML (XHTML) implementation can enable referencing connections from different document and even from different sources

http://www.w3.org/2006/07/SWD/RDFa/primer/

When a connection contains parts of text from different sources the system (according to me) should create RDF names referring to the texts attending the connection(s) and place this content in an RDF file attached to the content. It is not necessary to program all parts of text to automatically create RDF names, but I don’t like the idea to create RDF name referral when the part of text is connected not only with parts of text from the current document but with other part(s) of text from different document. It’s nice the connections about pieces of only one document to be referred to the RDF file attached to the document, too. This connections’ references should related to the parts’ of text references and this way forming RDF model of the connections and the parts of text. This way machine can be able to find this connections through parts of RDF requests (in order to take the all part of text which is a member of a connection the machine should use a new protocol/ trying to translate the document to an HTML file with a RDF) but not through a completely new protocol.

2.6 Tracing revision

http://garabedyan.wordpress.com/2007/11/18/ajax-wiki-editing/

In the above post I have explained that editing documents is just Editing or Adding content. In this way of thinking by using JS in Web Presentation Layer it can be easy to trace which is edited and which added.

Google offer of cutting letter count of words with the aim to save memory

Written by garabedyan

April 27, 2008 at 18:15

Data Flow Processing, eventBased Algorithms and Data

with 4 comments

I have made updates over the paper presented down here. Now you can read it in Bulgarian, too.

In OpenDocumentFormat (*.ODT):

In Bulgarian (BG): bg_paper_data_flow_processing_eventbased_algori

In English (ENG): en_paper_data_flow_processing_eventbased_algori

In PDF:
In Bulgarian (BG): bg_paper_data_flow_processing_eventbased_algori

In English (ENG): en_paper_data_flow_processing_eventbased_algori

10 November 2008y

Science claims that every system in every particular moment of time is describable with a discrete count of data variables. Applying this count of variable to an abstract model of this system is supposed to produce identical outputs in every time the application is done. Lets apply this model of scientific thinking to a computer application.

Data Flow Processing, eventBased Algorithms and Data (odt) (pdf). Main idea

Every program works by (dynamically) wiring atoms which receive input data and produce output of commands or data or both. Finding and separating as much as possible independent atoms and wiring them on an abstract framework (all input and output is manipulated through the framework) is an extremely efficient practice to decrease the computations to the only needed ones. Separating the software model into algorithm atoms. Separating the data source(s) and the data they contain into data atoms.

A common application architecture is:
A Common Application

My offer about a program written on new and abstract framework (scenario):
Write code to apply the business logic but not about every possible occurred change during run-time, but only implement the pure theoretical relations between input and output of every atom. The abstract framework encapsulates all the atoms and their inputs and outputs and decides which atom(s) to call when some program input (output of the outside world) is changed and which when some atoms’ (inside components) output values (data and/ or commands) is changed. This callings are recursive and can produce wave of callings in different directions of wired atoms. This way the abstract framework and the atoms will implement in run-time the theoretical knowledge about the relations between input and output of every atom and the outside world, something that developers do by writing code about every possible case (occurred event).

When an event is received only the related to it atom is called and is computed result (output data and commands), when the result is different than the situation before receiving the event the atom(s) which are connected to the newly computed result are called and this way recursively until there are no more atoms connected to any changed result or the result(s) isn’t anymore different from its past stage (the computation didn’t produce a change on the output data).
The biggest aim according to me is that a big computation is not needed to start every time when something small is changed but just finding which atomic computation have to be executed in order to react correctly on the change.

Event-Driven design forces developers to write code about every possible event. The problem is that some applications aren’t receiving only GUI events, but a lot of more events from sources which count isn’t within developers’ control. It is easier to implement the model, but not to cut the all model into event reactors. The letter is not upgradeable and looks more like a structure-oriented programming than object-oriented.

Brief presentation of the practical implementation of this idea:

Boxes (algorithm atoms) and circles (event triggers) are connected with lines. Some lines has pointers which shows how the interest is orientated. When there is no pointer, the interest is on the both directions. When some output result of any atom/ trigger is changed (on the base of some previous computation or some event) all interested atoms are called to recompute their output results because of the relation of the results with the change. This is repeated until there are no interested atoms of some result change, or the change doesn’t produce change in the result of interested atoms after the recomputation.

Complicated software system which is more Domain Driven Design than Event-Driven. Both of the figures contain computed and saved data in themselves. When some data (in atom or trigger) is changed and it is in the interests of atomic algorithm the interested atom recomputes it’s result according to the occurred change in the first one. Triggers aren’t interested in anything inside the program, they only present a characteristic of a system out of this application in which the trigger is placed.

Application areas:

Human User in the view of a computer application is a source of asynchronous commands. The user is free to choose the time to call a program functionality.

Computer
In data flow apps. When the application controls some systems/ processes and the software must fast react on changes occurred in them. A good example is a satellite which have to react on a lot of possible events while flying in the cosmos. The application which is designed to react on them can use this approach and make it’s code more upgradeable and changeable for future projects.
In big SOA services which make approximately one calculations for each request.  Example: http://garabedyan.wordpress.com/2008/12/17/eventbasedframeworkeventbasedframework/

Computer + User
Not in XP, where developers model user stories, but about applications which care about more circumstances, which aren’t synchronous. (*)
http://garabedyan.wordpress.com/2008/04/27/event-based-content-editor/
Mainly in content editing products where the user is treated as a creator and applier of the all algos and the content in general is as output or input. The rest computer aided products has in their core some techniques of tracing mistakes, errors and so on in users’ projects. The projects are computed from their beginning again and again every time something is changed. The only thing to be won in this kind of software is the time of recomputing the whole project when a change is made not in the whole project, but in a piece of it (when the object of work of the software and the nature of the data enables atomization in order to be made conclusion which atom data is changed and which is not).

(*) eXtreme Programming teaches developers to write code according to the possible user stories. The user of its own is one source of commands, which is synchronous. The user finishes filling a command and chooses executing it, the computer starts executing it and when it finishes, the suer is informed with the results. It is not a practice, the user to pause some calculation at the moment of its execution, but only aborting it.
In SOA architecture, we have one initiator of activity (computation) and he is again synchronous. No matter that we don’t know when a request is going to be received, the execution of this request is atomic and can’t be aborted or customized while it is executed.

Example of Computer application of eventBased
An example of Computer + User is presented in the eventBased Content Editor (http://garabedyan.wordpress.com/2008/04/27/event-based-content-editor/).

An example of real life system which is supposed to implement the described eventBased architecture is a space satellite. This is a a big embedded system doing many things concurrently which needs things to be known in a small amount of time.
Space satellites are embedded systems, which have for a certain period of time to find the most proper solution of an asynchronous occurred problem. If the solution is not proper its implementation can spend resource which is needed for different operation, if the solution is not found within the required period of time the entire satellite is possible to not exist аnymore.
Finding the best solution of a composition of commands (steps) is done by using decision tree, such data structures like which are used in applications for playing chess, which creates of recursive calculation of the possible command (chess move) and the consequences applied to the current situation for every separate possible command. The maximal period of time for choosing a solution and implementing it is supposed to change during the search and implementation of the chosen solution, this period of time is a dependent from the behaviour of outside (external) variables, whose behaviour is asynchronous to the system.
In order to enable the fast creation of this tree, fast computations of resource spending are required, which volume and quality is important to the outside world.
The author imagines single modules determining outside changes and in every such change the physical variable value is computed, which variable can be important to decision making in future. In the blog the author presents a way of enabling this data updates and a parallel adding of new modules and relationships between variables (formulas).

Theoretic Conclusion
MVC pattern and the Observer pattern between the View and the Model: If we say that the observer pattern inverts the control and makes the interested part to care about the interested data. By analogy with this post, we can say that if the function (procedure) is the atom of every program (command-based) so using this data flow approach, the function has to not call any other function and send him array of variables, just changing variables which the other function is interested in.

This data flow approach about every function is not general applicable, because of memory efficiency problems. This is the reason why I make difference between data changes and commands, why I speak about an abstract framework, but not about a new programming language. But at all I thing that I have give another definition of Data Flow programming by using Inversion of Control terminology.

Practical Conclusion
I hope that this will open a door of parallel using data flow and command like program developments, using more observer patterns in the business logic. Declarative programming plus Command programming.

Written by garabedyan

March 4, 2008 at 10:59