Is Enterprise Software Boring?

Posted in Business thoughts, Future, Opinions on October 4th, 2010 by sinica – Be the first to comment

Reading this post: http://ravimohan.blogspot.com/2006/07/but-martin-enterprise-software-is.html I’ve remembered that basically  I have the same beliefs. Doing a framework for enterprise software is not boring at all. Of course we all know that. Doing one to be successful is hard. I’m trying for the 3th time to create a real maintenance cost killer framework for Enterprise software and finally I’m happy with the results (Quark 2.0 is just awesome!!!)

It is almost common sense that a business idea should be a little boring in order to be a good businesses idea (and i’m a little afraid that the work for the framework was  not boring enough :) ).

Our business strategy:

  • create a technology to reduce creation/maintenance costs for enterprise software (with real programmers in mind,even if we are oriented even towards beginners or more business oriented people). Yes, you have Spring,Rails that are OK for programmers with medium experience but we can do much more for “Excel programmers”  but also for programmers with various skills and interests!
  • looking for a way to replace Excel :we are not creating a spreadsheet clone but we want a tool with a similar learning curve as Excel for nontechnical users
  • flood the market with good quality software for SMBs (open source and commercial)

Given that, I don’t think Enterprise Software is boring for everybody (is boring only for some hackers) . There are enough people (actually many many people) that have business orientation and skills to use modern programming tools for the creation of new, beautiful and useful software for companies without even asking themselves if it is boring or not.

Startup presentation for Axiologic SaaS

Posted in Business thoughts, Future on October 3rd, 2010 by sinica – Be the first to comment

We are preparing a presentation for how-to-web startup contest  http://www.how-to-web.net/startup-challenge/

Wish us good luck!

Backup linux server

Posted in Examples, Q&A on September 13th, 2010 by cmanolescu – 1 Comment

A simple way to backup your server.

Backup mysql database:

mysqldump -u $mysqlUser -p$mysqlPassword database > dump.sql

or you can dump all databases to a single sql file

mysqldump -u $mysqlUser -p$mysqlPassword --all-databases > dump.sql

Backup postgresql database:

pg_dumpall -U user > dump.sql

but because this will execute on server there will be no user interaction so for this to work you need to create a .pgpass file in your home directory.
NOTE: make sure it has permission 600 or else it will be ignored.

cat > ~/.pgpass << ^D
host:port:*:user:password
^D
chmod 600 ~/.pgpass

You may need a remote server where to store your backup and you also want to connect without providing a password (a good tutorial can be found here).
NOTE:
a) make sure ~/.ssh exists on remote server and it has permissions 700
b) use “-p port” if ssh is not on the default port

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub "-p port remoteUser@remoteHost"

An easy way to backup your files on a remote server is to use rsync

rsync -e "ssh -p remotePort" -avrp localPath remoteUser@remoteHost:remotePath

Create cron job

cat > /etc/cron.weekly/remote_backup << ^D
#!/bin/sh
######### Start backup script #########

######### End backup script ##########
^D
chmod 700 /etc/cron.weekly/remote_backup

Backup a folder to a tar archive

tar zcvf /archive/etc.tgz /etc/

or backup the entire server

tar -zcvpf /archive/full-backup-`date '+%d-%B-%Y'`.tar.gz \
    --directory / --exclude=archive --exclude=mnt --exclude=proc --exclude=var/spool/squid

Download complete backup script

wootHackwoot ?

Posted in Flex, Opinions on September 13th, 2010 by sinica – Be the first to comment Tags: , ,

If you know what  wootHackwoot means,we would like to ask a question: Why is so buggy the “Classes” tab from “Flex Library build Path” ? Why we should manually check those radios  when we are updating code from the source control? I imagine that “Include all classes from all source projects” is an easter egg that will popup with some nice sexy clips when we click for the millionth time? I’m not upset,just annoyed a bit. Flash Builder and Flex are such nice tools but  some features within Eclipse integration are just staying in our way. Adobe,could you fix these annoyances please?

Asynchronous programming and MetaData

Posted in Programming Philosophy, Quark framework on September 4th, 2010 by sinica – Be the first to comment Tags:

Even if asynchronous programming can get tricky, it enables a beneficial declarative  coding style.  I will present a few use cases for which  benefits outweighs the risks (risks that could come from bad/stupid programmers mainly):

  • Form validation.  Data validation is a natural part of the model (remember the fat model idea) and it is not part of view for sure. With triggers in quark, it is possible to easily set metadata about invalidity of fields/objects and the view  will just reflect changes in metadata.
  • Loose coupling in MVC and support for View States (quark terminology). The idea is that a type of data (an object) should be  differently viewed by the user depending on internal values.  In quark, asynchronous triggers will watch member values, set  a ViewState metadata and the view is switching to a proper view. Imagine doing this in a pure procedural way… This solution offers  the best possible loose coupling in Quark’s MVC  (only one way loop communication between V-> C ->M->V in this order)  .
  • Implementation of the business rules layer.  A way to  enforce specific business rules on the quark models is by using triggers that  will watch values and as result will create new objects,change values.

Asynchronous programming is too complex?

Posted in Programming Philosophy, Quark framework on September 4th, 2010 by sinica – Be the first to comment

I was always passioned on how to make programming a easier task. A direction that looked promising to me when I was a student was about programming techniques based on asynchronous behaviors. Asynchronism allows a declarative style that can simplify(minimize) the code,at the expense of  some complexity in behavior.  In many cases that is the right thing to do (such asynchronous code could be expressing business rules (what) and not how you do low level variable management => usually a very good practice ) but you have to simulate it in pure synchronous programming languages.

Many years after school, when I discovered Action Script and his events model based on observer design pattern, I instantly liked it.  I know that many programmers have serious problem dealing with asynchronism in their code and for good reasons (and others are abusing it when simple function calls should be used ). The usual solution is to create synchronous layers  inside of an asynchronous environment and hope for the best ;)

In Quark’s model description language, we have the idea of “trigger”  that is basically a function/observer that is automatically called when other objects get changed. While this is a very natural way for describing model’s behavior, a naive implementation of the triggers can become very tricky to understand. The cause looks to be the intuition of atomicity of changes in a function.

class example
{
 var a:int; //should never take a value greater then 10
 var b:int; //should be always 10 * a, or 0

 [trigger on a changes]
 function trigger1()
 {
   if(a >= 10)
   {
    b = 100;
    a = 10;
   }
   else
    {
     b = a * 10;
    }
 }

 [trigger on b changes]
 function trigger2()
 {
   if(b != a * 10)
   {
    b = 0;
   }
 }
}
 var e:example;
 e.a = 11;

Above code (in a hypothetical action script dialect) should result in e.b having value 100.
Still, a naive implementation of triggers, could lead b having value 0 if trigger2 get called immediate after b = 100. This is just a simple example that reveals how evil the asynchronism can get.
We will take the risk in Quark Framework to implement asynchronous programming but we try to prevent things like unintuitive/unexpected behaviors or infinite loops caused by asynchronous events.
The syntax of Quark Schema language is a mix of XML and Action Script (but not really like MXML) and we will publish/document later (before the first release of quark 2 planed in October).
The way of preserving atomicity intuition about functions/triggers, it is also a good way to minimize the number of function calls (especially calls on intermediate results).

Eclipse’s “auto completion” and dependency (without injection)

Posted in Opinions on September 4th, 2010 by sinica – 1 Comment

We depend so much on our tools. Yesterday my Flash Builder(Eclipse based) stopped helping me with code assist functionalities (auto completion mainly) and I had a real problem producing something useful.  I spent a few hours finding a solution and I was very happy when I got it solved. (It was one more Eclipse madness, after reinstalling all,creating new workspaces,etc etc, I realized that i was importing Flex projects as existing Maven project not as existing Eclipse projects. Right: silly,silly silly bug in Maven plugin probably )

Are we as programmers becoming too dependent on our tools? The answer is “yes” . But there is no other choice. As humans, after the first stone we started using, we remained very dependent on our tools but that it is what makes us so successful.

Actually, here at Axiologic, we bet our money and time on creating a new generation of  RAD programming tools  (for programmers, consultants and middle management) so apparently we  should try to behave like drug dealers for geeks :)  (unrelated but a funny link http://archive.silliness.org/drugsvsgeeks.html)

We work hard to make our software your next drug! (we have even auto completion for writing code fast  ;) but we bet on intelligent tools and architecture to minimize the code that should be  written)

MVC,MVC,MVC… but how to resist to the bad temptations?

Posted in Quark framework, UI design on August 28th, 2010 by sinica – Be the first to comment

One question that sooner or later  the architects of a MVC framework should ask is how the system will be dealing with creation of error messages and pop-ups.  In Quark,we are trying to be consistent with our philosophy of strict separation and one single sense communication between model,view and controller.  Given that, a simple solution like calling PopUpManager.Show from view,model or controller it is not possible or  a good thing.  Other framework have the luxe of using Facades and Mediators to put code like PopUpManager.Show and do there the dirty work but we want to keep things simple and editable from UI.

Our solution is a bit abstract but it is using the MVC as it should do: there should be always a special place in  model where a controller can add a message or an object instance and that cause automatically the view to show a popup! Basically, we just create a convention and we expect quark’s view components to follow. That special place can be for example a special metadata member for the current data object.

Conclusion: in quark, pop-ups get displayed when they are requested by model or controller by stetting values in metadata and they are never directly displayed using direct calls.

What benefits do we see here?

  • the code needed to create an application is shorter,cleaner and easier to write and maintain
  • the code  for quark based applications have very few dependencies on platform’s APIs,the code is focused on  user’s problems and just follows a few standard conventions to achieve its goals. That will make easy in future to write quark like platforms in Java Script,Silverlight  or any other  technology and having the final application still working perfectly.
  • this is a practical approach for having MDA’s advantages without UML or other abstract and esoteric technologies. We try to minimize even the design patterns we use inside of the framework but should not be a concern for the final user of the framework.

Meta-Data in quark

Posted in Flex, Programming Philosophy, Quark framework, UI design on August 28th, 2010 by sinica – Be the first to comment

As a MVC framework, quark have a nice solution to the control of views using data from  model.

Firstly, we have a convention that every component we display in a quark based application has a model object instance that keeps the status and current configuration of that component. We call those object instances: shadows and we call the shadow classes,those quark classes that describe shadow objects.  That magic of quark is that it automatically creates UI for editing quark classes and in this way we have cheap UI to configure everything in current and future quark components.

The View is responsible for reflecting changes in model and for simplicity and loose coupling we don’t allow direct access of controller to the view . But if there is no direct connection how we control the UI?

Te answer stays in something we call metadata . A meta-data is like a member of an object,except that it is not a member that get persistence or UI. Meta-data can be attached to any quark object or to object members.  We identified a set of standard meta-data but any view component can need a different set of meta-data:

  • ViewState metadata type ( not a very intuitive name,we are still looking for one) is probably the most important type of metadata.  This metadata give a hint to  quark about what shadow clone to use for UI configuration when a class instance  should be  displayed.  It simpler than it looks, basically every class instance in  model should have a ViewState metadata that is a name of a configuration used   to display/edit that object.
  • ReadOnly metadata – an object with this meta-data set is obviously a read only objects
  • Invisible metadata (for fields or objects)
  • Label  metadata – what label get displayed when an object is displayed in a list,etc
  • Icon metadata

We will show how it works  in some demos,soon.

References to class members in PHP

Posted in Examples, php code on August 27th, 2010 by sinica – Be the first to comment Tags: ,

We have decided to switch the server-side of Quark Framework 2.0  to the php language. The main reason is that PHP is everywhere,many programmers (and even non programmers) can deal with  it and we can be more agile with PHP than with java. Also the hosting costs for SaaS are lower with PHP.  I did programming for more then 14 years in strongly typed  languages like C,C++,Java,C#,Action Script and I hate that I don’t have types for parameters in php  and I don’t like how strange is PHP occasionally (php references are unlike others in any decent language I’ve ever used, the insane and ugly $this-> is annoying etc ). I’m not a big fan of Php but for what we need it is a rational choice (Don’t forget the unit tests or you are doooomed :) )

Anyway,PHP is serving us well and I’ve decided to share here a small php class that will act like a sort of reference to function members. A closure could solve sometimes the same problem (sort of) but it will not make the code clearer. And it will not work for calling members from another class/instance.

class FunctionRef
{
 	protected $mythis;
 	protected $myFunction;

	public function __construct($mythis,$myFunction)
	 {
	 	$this->mythis = $mythis;
	 	$this->myFunction = $myFunction;
	 }

	 public function call()
	 {
	 	$args = func_get_args();
	 	call_user_func_array(array(&$this->mythis, $this->myFunction), $args);
	 }
}

If you know a better way on doing this in PHP, I will be glad to know.