An Alternative to AngularJS and Ember…?

JavaScript FrameWork BenJS  – Version 0.2.0 released!

Today I released the latest version 0.2.0 of the JavaScript FrameWork Ben.JS. You can take a look at the idea and concept of Ben.JS on the project homepage.

My main goal for this project is to provide a tiny small and simple alternative for the big players in the area of Singe-Page-Application Frameworks (SPA Frameworks) –   especially Angular and Ember.

Today JavaScript is not only a widespread programming language, but also a platform to develop clean and stable web applications. But first of all, this is not the merit of frameworks, but of the language itself. A good way to learn using JavaScript in the right manner is the Book ‘JavaScript Patterns’ from Stoyan Stefanov.

I am convinced that for a good JavaScript application it’s enough to know the most important patterns and to understand the right usage of jQuery. And here is the most important reason for BenJS:  The core function of this framework is to transport data models into a Web page and to manage user inputs according to the data model. But in my eyes it is also important to understand, that the business logic should be encapsulated into a Web- or MicroService. For my understanding it is not the task of JavaScript to implement business logic! If you follow this principle and hide your business logic into a WebService, BenJS will be the right alternative to bring your business data into your Web application.

If you have any ideas, questions and feedback join the project on GitHub!

 

Wildfly – HeapSize

The default memory setting for Wildfly are not very high and can be to less for deployed applications. The default VM settings are typically:

  • -Xms64m
  • -Xmx512m
  • -XX:MaxPermSize=256m

For production mode this can be increased by editing the “bin/standalone.conf” file. To increase the memory size from 512MB to 2GB change the following line from:

JAVA_OPTS="-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"

into

JAVA_OPTS="-Xms2048m -Xmx2048m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true"

The settings depend on the applications deployed on wildfly.

JavaScript Framework Ben.JS version 0.1.0 released

Today I started the release 0.1.0 of the JavaScript Framework Ben.JS. The new release includes improvements of handling view templates and for-each blocks. We tested the framework within the latest version of the Imixs-Workflow AdminClient which is now based on Ben.JS and the Imixs Rest API.

Ben.JS is a plain small and easy-to-learn JavaScript framework for single-page-applications (SPA). The framework simplifies the way to create powerful JavaScript Web Applications with a lightweight MVC framework. Read more about Ben.JS here.

 

Debian – Laptop Power Calibration

Since 2 years I have a Wortmann Ultrabook running on Debian. Since some weeks the the battery life has deteriorated sharply. I found this helpful article about the linux tool ‘powertop’.  You can use this tool to recalibrate the battery of a loptop using the following command:

sudo powertop --calibrate

At a first look it seems like this helped much to improve the power management of my laptop.

Building Websites with Markdown and Maven

If you want to setup a new web site, today there are a lot of frameworks and content management systems in the market. One of the most common is WordPress which can not only be used as a blog software but also to build pretty web pages. But WordPress has some disadvantages in my eyes. It is build with a lot of PHP code, you need a database and at least you will be attacked by masses of hackers. If you only plan to setup a small web site you can do this with pure HTML. But this isn’t an ideal solution if you want to separate content form design – which is a best practice in these days.  Continue reading “Building Websites with Markdown and Maven”

Singe-Page-Application = Don’t think about the business logic!

Today, I discussed with some capable developers the pros and cons of SPA frameworks. This discussion resulted in a debate about the business logic in SPAs, which brought me to the following thoughts about a SPA architecture. In one sentence: Don’t think about the business logic!

Why? Take a moment and remember about the basic idea of a Singe Page Application, what is the general concept behind all that? Basically it is the fact that we can represent any kind of information in modern web browsers. Using HTML5, CSS3 and JavaScript enables us to deal with information in a very easy way. Browsers were build to present information – noting else!. JavaScript on the other hand is just a way to deal with some behaviour how to represent information to the user. For example: fade in some very important message, or show a bubble information text when the user moves the mouse over a picture.

On the other hand we today know very well the concept of REST Services. This is one of the major enablers of Singe-Page-Applications. All frameworks, like Backbone, React, AngularJS, Emer.JS or Ben.JS deal with REST Services and help us to handle the information which we want to show to the user. But if you think about that – these frameworks were build on the following problem: how to present data in a Web Browser using JavaScript?

Today the most SPA frameworks also deal with a heavy load of functionality which makes it hard to understand most of these frameworks. This is because people began to think about another problem: How can we process information? But this the domain of business logic. In the past this business logic was placed in server side frameworks like JEE or Spring. I think this is the right place for this kind of logic. A server should think about how data should be stored in a database, validate data, transform data or update data depending on various business rules. But the time when the Single-Page-Frameworks become more and more common in modern development, many people begun to believe that JavaScript is now the place for business logic. And so we began to use REST Services just to store and fetch data entities. But this is absolutely wrong! Business Logic means to deal with business data in a way  going conform with the business process. So business logic is something which is related to the data and not to the representation of data!

So at the end this means that you should put all your business logic into your REST Service API which is the interface between your Browser front-end and your database back-end. And now you will see what Singe-Page-Applications are really good for: they just represent the data provided by your REST Services. No business logic here! Just show the user the data provided by the back-end. This means: if there is data – show it to the user – if there was something going wrong with the data – show the error message to the user. A Singe-Page-Application can be as dumb as a Terminal application in the 1980s. Put your business logic into the back-end, and use SPA to represented your data. The result will be a  be scale-able, flexible and modern Web Application. And the best: You don’t need to worry about which framework you choose on the front-end. No matter if Angular 2.0 brings up a new concept. The goal of your Web Application is just to represent information – nothing else!

Take a look at the open source project Ben.JS which solves the problem of representing data in a web browser….

Linux Debian and Skype – no microphone

Today I had a strange problem with my skype installation in Debian. The microphone seems not to work. Finally I found the solution here.

The trick is the following:

  1. Open the Sound settings when you start a skype test call.
  2. Click on the tab ‘Recourding’
  3. Choose the option : show ‘all streams’ at the bottom of the tab
  4. Now when the skype call runs you will see the skype application appearing
    skype_audio
  5. There is a tiny button muting the microphone. This option was selected in my case. Deselecting the mute button solved the problem for me

Why I started another Singe-Page-Application Framework

Today I decided to start a new open source project providing a singe-page-application (SPA) framework. This sounds crazy, because we live in a time in which so many different spa frameworks are developed.

The reason why I am interested in singe-page-application frameworks is that I have an existing complex JEE Application build on JSF 2.0 and I am looking for a way to reduce the evolved complexity of my web front-end. I don’t think that JSF can compete with SPA in modern web applications. On the other hand I already have an existing Rest Service API in my application. So this is the reason why I stared to look around for a SPA framework that fits my needs.

Continue reading “Why I started another Singe-Page-Application Framework”

Single Page Applications – AngularJS vs. Ember.js

I just started to develop my first JavaScript single page application (SPA) and so I took a look on different JavaScript frameworks. I just want to share some of my thoughts here:

My own background is JEE and I have developed a JEE application with EJBs, JSF and a little bit jQuery. Because of the fact that my existing project (imixs-workflow) provides already a REST API, migrating from JSF to a JavaScript SPA looks promising .

Continue reading “Single Page Applications – AngularJS vs. Ember.js”

Eclipse Luna crashes on Ubuntu

Today I had strange problems with Eclipse Luna after an Ubuntu Update.
The solution was changing the eclipse.ini by adding

-Dorg.eclipse.swt.browser.DefaultType=mozilla

and changing the memory settings.
Thanks to Bård Aase Blog: http://blog.elzapp.com/2014/07/01/making-eclipse-kepler-and-luna-work-on-ubuntu.html