Home  /  RSS  /  RSS Comments  /  Enter

Asp.Mono in Linux? Not Yet...

Thursday, August 7, 2008, by artyom ; Posted in: Progress, Benchmarks; one comment

During development of CppCMS I have always wanted to do some benchmarks against one of the most popular web development technologies: Asp.Net. I had found a blogging system: BlogEngine.Net that in its latest version had full support of mono under Linux, support of MySQL --- all I need to run benchmarks against CppCMS.

The beginning was promising. The instructions were simple, there was an actual blog running BE.Net under Apache mod_mono on Ubuntu. There were Linux specific instructions as well.

So, first of all I had installed mono 1.9.1 from Etch backports. The first problem I had to deal with was an installation problem --- the version of C# compiler and mono environment were different. This was solved quite simply. So, I could finally see BE.Net running under Mono using XML as data storage backend.

Then, I wanted to add MySQL storage backend. The problems had come very soon. The MySQL database script was written under assumption that table names are case insensitive. That was not true for MySQL under Linux. This problem was fixed.

more...

Thoughts about template system

Tuesday, August 5, 2008, by artyom ; Posted in: Templates, Framework; 5 comments

After looking how ASP.Net and J2EE work I thought a lot about current template system.

Today, CppCMS template system is dynamic typed. For example in order to render template:

<% template mycontent %>
<p>You have <% number %> of <% something %></p>
<% end %>

I write something like that (not correct code but idea):

map<boost::any> content; 

content["something"]=string("orange");‎
content["number"]=10;

template.render(content,output); 

The template is compiled to bytecode and than interpreted in rendering engine. If variable title required it checks its type and renders its content.

Another possible approach it to make is statically typed :

So, I create a view interface for template:

struct mycontent: public content {
  string something;
  int number;
};

And then the above template is compiled to following C++ code:

void mycontent::render()
{
  cout<<"<p>You have "<<number<<" of "<<escape(something)<<"</p>\n";
} 

That is compiled to shared object that I can load dynamically. And render template as following:

auto_ptr<my_content> content(template.get("my_content"));
content->number=10;
content->something="orange";

content->render(output); 
more...

Caching System: Internals

Thursday, July 31, 2008, by artyom ; Posted in: Cache; 0 comments

One of the latest implemented features of CppCMS is a caching system.

Each cached entry is stored using:

For example: main page that displays 5 recent posts may have a key main_page and triggers: post_123, post_124, ... , post_128. More then that, each time, during page build, when you fetch some cached data, like a sidebar or set of options, their sets of triggers are automatically added to the set of triggers of the page you build.

For example, when the page is created and sidebar block is fetched from cache all its triggers are automatically added: if sidebar depends of options, then trigger sidebar and options will be automatically added to triggers of main_page.

Thus, when certain trigger is risen, all pages that depends on it are automatically trashed. This makes a cache system quite powerful and easy to control correct data representation.

The developer is expected to create a rational model of data/triggers that represent the relations between parts of internal data and rise these triggers when committing changes to database.

more...

First Beta Version of CppCMS is Out!

Friday, July 11, 2008, by artyom ; Posted in: Progress; 16 comments

First beta version is avalibile under LGPL 2.1 from SourceForge.

It includes:

Good Luck!

API Changes and mod-prefork

Friday, July 4, 2008, by artyom ; Posted in: Progress, FastCGI, Framework, Cache; 0 comments

There have been lot of work in recent weeks in order to make deep internal changes in the framework. Now they include:

  1. Transparent support of 3 web server APIs: fastcgi, cgi and scgi.
  2. Support of new mod prefork that allows safer management of worker processes.
  3. Implementation of a cache that is shared between forked processes.
more...

previous page

next page

Pages

Categories