Software engineering

Creating a bytecode based programming language, part 2

This is the long, or not, awaited second post about creating a compiler.

In this post we will talk about parsing a source code.

Read more…

Creating a bytecode based programming language, part 1

This is the first of a series of short posts about a subject I am currently working on as a personal side project: creating a compiler to create bytecode based programming languages.

Read more…

Implementing a VFS

While trying to implement a Virtual File System, that is to say a virtual representation of an hard drive with its folders and files, there are two main approach to consider:
- a tree based approach
- an absolute parent path approach

Read more…

Ontology Oriented Programming

I will soon start to write about Ontology Oriented Programming, that is to say a Knowledge based approach to programming, to distinguish from Object Oriented Programming whose only purpose is to write software.

With ObjectOP, a software extract and analyze data to give informations. For knowledge to be created it require a human being to read this information. ObjectOP is a data processing approach, perfect to be used in a workflow or expert system.

In OntologyOP, the main purpose is to store, manage and create new information and knowledges using reasoning. Ontology is an information reasoning approach, appropriate for Knowledge Management Systems and Artificial Intelligence.

Creating a communicating app: what to think about

There are a few things to remember if you intend to create a network using application.

First of all, never assume your link will always be up and running.
- What to do if you can’t connect to your network ?
- What about if you got disconnected ?
- How and when will you notice a connection failure ?

Secondly, always avoid synchronized request, even if it’s true they are easier to create than asynchronous one.
- You can’t really cancel a synchronized request, you can only either destroy the thread it is running on, or wait for a timeout.
- With the asynchronous way you can start working on the result before it has been totally retrieved.

Thirdly, reduce the quantity of data you need to send and receive to a minimum.
If an XML message is easy to create and read, it has also a poor efficiency regarding the quantity of information it contains for the length of the message. Regarding transmission efficiency, the best method is to work on raw data, without any encapsulation, but it’s also the worst method considering debugging. A good alternative is the use of JSON, quite light and still human readable.

The fourth point concerns protocols designing. If you are conceiving your own one, you should keep in mind it may be subject to updates. That’s why it is always a good idea to send a version number in your messages. It would be helpful for maintaining compatibility with older versions of your software that would still work with an older protocol.

This list isn’t exhaustive and will most certainly be updated.

Design Pattern: Singleton

The singleton is a design pattern used when it is needed to have one and only one object of a certain class.

As the singleton instance can be accessed from anywhere in a system, this design pattern can be used to coordinate actions, or to replace global variables.

design_pattern_singleton

Design Pattern: Factory

The Factory is a design pattern used when it is needed to create objets without having to specify the exact class to implement. We only know need to know the general usage of the implemented class, not the internal operations.

That’s why a Factory return objets who are either :
- from a class extending a known abstract class,
- or from a class implementing a known interface.


Design Pattern: Factory