Garo Garabedyan's Divergent Thinking Blog

Function as a class. Let everything to be SOA and Concurrency compatible

leave a comment »

Just like the old functional programming languages like LISP

In OOP languages an object is built up by private or public functions and variables in general. In this manner I ask to technically treat at programming language or framework level the function as an object.

Object can be inherited and can inherit (object) and implement (interface). Reference to an object can cause object casting.
Function can’t be inherited and can’t implement, too. Reference to a function can cause object casting

Procedural languages provide local and global variable distinguishes and encapsulation in this manner.

It is a design principle to use objects only when you need them, not always in order to not make an useful class diagram. For the rest of the cases use algorithms written in functions.

Advantage: Can have a link to a function and this way call it. Can cast function and use its past implementation. To force object casting with a reference to a function, not only with a reference to the object.

Making things more SOA, but not distributed.
To not engage only with the object, but also with the function. Apply this to parallel problems where you have to lock some code in order to ensure secure execution.


Written by garabedyan

February 29, 2008 at 19:02

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s