Garo Garabedyan's Divergent Thinking Blog

eventBased Framework

with 2 comments

(DEAD-LINK: Documentation in Bulgarian) http://unidevelop.org/wiki/project_embedded_apps_lib

(Documentation in Bulgarian about the university project) Garo Garabedyan, eventBased Framework documentation

(DEAD LINK: SVN Project home) http://unidevelop.org/browser/unidevelop/programming/projects/eventBasedFramework

(Source code- a single C file) eventBasedFramework source

Newspaper "Технически авангард" ("Technical avangard" in English), published by Technical university-Sofia, copy 1, February 2009, p. 1

Newspaper “Технически авангард” (“Technical avangard” in English), published by Technical university-Sofia, copy 1, February 2009, p. 2

A small C OpenSource licensed framework implementing the ideas of eventBased Algorithms and Data and Data flow processing (https://garabedyan.wordpress.com/2008/03/04/data-flow-processing-eventbased-algorithms-and-data/) was implemented for my university exams. I have win first place best programming project in Unidevelop, Technical University- Sofia, the organizers granted me an ASUS EEE PC 4GB which event was presented in the front page of New technical avangard (official newspaper of Technical Univesity, Bulgaria) in February 2009. The commission have granted me the 1-st place motivated by (listed in the news article in the newspaper of the university):

  • Active work on the project even after the marks for the semester;
  • Completely made by himself documentation, containing theoretical explaination of the problem, practical implementation, future development possibilities and used information sources;
  • Well structured and commented source code.

The framework is aimed to handle embedded applications, but its core is universal in the context of the expressed assumptions about Object Oriented Programming (state and behaviour) eventBased Data processing (Observer pattern). Client- programmer is able to easily create variable containers and declare to them the interested functions in a change of the stored variable. Every time a variable value is changed the interested functions are informed.

Future development of the project is adding Aspect-Oriented like functionality which to enable the client- programmer to declare aspects (functions) and functions (or aspects) to be called before and after the aspect’s code is executed. Very useful to be aspects I think functions which produce outside the MCU commands.

I have used Erik Meijer: Functional Programming; MSDN Channel 9 Going Deep Show http://channel9.msdn.com/shows/Going+Deep/Erik-Meijer-Functional-Programming/ as an additional theoretical source of programming language science.

The client- programmer uses the platform as a library for calculating decision tree finding the right result in as a small period of calculation time, as possible; optimization of calculation in the program which depends on external variables (especially for those which are part of the decision tree if meet the letter condition) by in advance calculation in every change (revision) of the value of a variable.

eventBased Framework is a platform architecture aimed to advocate declarative programming in programming products handling asynchronous events.

I believe that the architecture of a program must inherit the structure of a natural science like Physics in example. There is a pure scientific explanation within the idea of of declaring and defining by such formulas in small modules source code. Programming is of its own translation (virtualization) of a real phenomena in electronic form, which is all what natural science do. The history of development (introducing new more concrete ideas and visions) of sciences goes through this process. Science tries to generalize and collect “if-then” observations describing behavior of a certain class phenomenas by transforming them into laws predicting result of a system in a moment in future. This laws have such mathematical form to enable calculation and analyze.

As far as Object Oriented Programming is an engagement of state and behavior, object oriented code can be written in languages which does not support insight mechanisms of encapsulation, powerful polymorphism with class interfaces and casting. Using methods of memory addressing with references and addressing code pieces with references to functions, engagement of state and behavior can be reached. This source code is reusable (re-editable) in a result of this OOP powerful character.

MCUs during their work handle input events. From this point of view a certain amount of variables exists, which is defined with input/ output functions important for the behavior of the system.

It is strongly recommended (close to restriction) functions called in advance to not result in hardware commands outside the MCU. Such side effects are supposed to be coordinated with the purpose of the concrete technical system.
In order achieving optimization, it is important every significant heavy calculating function to save (declare) all its input and output variables (including code side effects and dependency injection) in the global dynamic array of containers of variables (implemented by eventBased Framework) meanwhile to register its interest of all input variables in their concrete containers. When such code is called it must immediately return the execution of the program after checking if the input variables’ values have been already examined by the code.

Conclusion: Multi- stage programming and object’s oriented most significant functionality of encapsulation of state and behavior are implemented intelligently in one homogeneous software architecture unit enabling interruptions for reacting on urgent events. In parallel to reaction on every small change of some value in variable containers, the client- programmer can write functions reacting on interruptions which code on a base of small calculations of the present values in variable containers to calculate the needed reaction on the urgent situation.

Scanned diploma for 1st place in programming competition UniDevelop (TU-Sofia) with a C++ project

Advertisements

Written by garabedyan

December 17, 2008 at 17:46

2 Responses

Subscribe to comments with RSS.

  1. […] With an aim to promote knowledge on the above, I have made a transcript of the introduction of Taha (~10 min.). I was facing common problem domains in G. Garabedyan, Data Flow Processing, eventBased Algorithms and Data, 2008 and particularly in G. Garabedyan, eventBased Framework, 2009. […]

  2. […] in 2008 I was developing a framework on C implementing a custom event-driven architecture relying on pointers to functions, and, thus, […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s