Posts

Spec - Part II: The Layout

Image
GUI Development in Pharo Smalltalk using Spec. It covers the layouts and tidies up the Greeter application built in part I.  Last updated: March 2019 Introduction First of all: have you read the first part of this series yet? If not, please do so as we are going to iterate over what was done there. As you recall, the greeter application which was built earlier was fully functional. However, it was not easy on the eye --in other words, it was very ugly. As promised, we will tidy it up in this episode. The Question Of The Ages "What do you want!?" Before setting off on the road of endlessly pushing and pulling widgets around, let's first settle for a target design. For the rest of this episode, we will try to achieve the following design (this design is done in LibreOffice Draw and is not a snapshot from the system): Figure 1 - The target design for this episode Layout Smithing Tools There are about half a dozen of layouts and widgets (which can be used ...

Spec - Part I: The Basics

Image
GUI Development in Pharo Smalltalk using Spec. It covers the basics concepts and walks you through the building up of a Spec version of the legendary "Hello, world". Last updated: March 2019  Introduction Spec is a UI library for Pharo Smalltalk. Well, to be more precise, Spec is a library for describing UI elements, their properties and their behaviour. Under the hood the output of Spec is fed into a UI framework like Polymorph to draw the widgets on the screen. In this series of tutorial episodes, you will understand its concepts and learn how to use it for your everyday UI programming requirements. Prerequisites For this series we will use Pharo 7.0 (the latest stable version at the time of writing this) and since Spec is already included in Pharo 7.0, you don't need to do anything. Just create a package to put in all the classes that we create -- let's assume My-Spec-Tutorial as the name. The First Window Windows are the primary containers for ot...

ADempiere: How To Use Scala For Customisations

Image
Scala is a viable alternative to Java. This guide shows how easy it is to develop ADempiere ERP customisations in Scala. Introduction Scala is becoming an increasingly popular language and for many companies/developers it's a superior alternative to Java. ADempiere open source ERP/CRM , is written in Java but since Scala runs on JVM and has very good Java interoperability, it's very easy to customise ADempiere with Scala. We'll see how it can be done. Prerequisites The only things you're going to need is ADempiere binaries.  You can either download them from SourceForge or build it directly from source with RUN_build (at the time of this writing 3.7.0LTS was the latest). JDK 1.6 Scala 2.10.x  (at the time of this writing 2.10.2 is the latest) SBT 0.12.x (at the time of this writing 0.12.4 is the latest) Project Template I have created a template project which is hosted on github to speed up things for people. First clone it: git clone https://github.com/bahm...

Grails: How To Secure Your Application Using Spring Security Core

Image
A step by step tutorial on how to use Spring Security Core to secure your Grails application. Introduction Any web-based application must have a mechanism for authenticating users and authorising them to do their defined activities in the system. One can go for the traditional approach of doing it with a login form; it works for the start. But on today's Internet, a classic pair of username and password is not always available as many people prefer to use a single OpenID, Twitter or Facebook account to access their data across different web sites. Also in corporate environments usually authentication and authorisation is done against an LDAP database. This is where Spring Security collection comes to play by allowing you to connect to a wide range of data sources and acquire access information from them instead of strong them yourself. At the heart of Spring Security lies Spring Security Core and as usual there's a Grails plugin for that! Let's see how we can use it. ...

A New Platform For Business Application Development

Image
Anybody who has been involved in developing a business application, has already exhausted the long list of frameworks/libraries in JVM, .NET and Python platforms searching for something that reduces the costs while increases the development speed. However it's almost proved to me that one should seek the answer in less explored/popular platforms. Let's meet Pharo! Introduction Well, the title of this blog entry may be a bit confusing as the platform I'm going to talk about is not "new" at all! In fact, it's been around evolving far more than most of us know and could imagine. As a polyglot programmer, for the past 5 years, I've been trying many different languages and platforms to find one which would help me reach my goal: to write a business application (ERP) which can be run in hosted mode (SaaS) and is easily maintainable; and I had a short list of features/characteristics I was looking for in any of them. Note: I will elaborate on software as a ...

Immutant (Part I): How To Install And Use With Noir

Immutant is the new player in the Clojure web development; not a framework but the first Clojure'esque application server. Let's see how well it fits in the Clojure ecosystem. Introduction If you have ever done any web project in Clojure , you certainly know about the dominance of Jetty in Clojure web development realm as almost all Clojure web frameworks ( Compojure , Noir , Moustache , ...) rely on Jetty to deliver their promises.  This is not bad at all: Jetty is a lightweight servlet container with a small memory footprint which serves you well for a usual CMS like website.  But if you need to use services like messaging or need to deploy your application to a context other than root or you want profiling, resource management and such, then Jetty may not be your best choice. But there's this new kid in town and he's one tough kid: Immutant .  It's basically JBoss AS7 along with clustering, caching, XA transactions, scheduled jobs and daemons packaged for C...

How To Setup A Fossil Server

Image
Fossil is a light-weight DVCS that can be easily used on the web through the brilliant web server nginx. Introduction If you've ever done professional software development, you already know that it is not possible without source control and issue tracking software. In this article, you will see how easy it is to setup a fully working Fossil DVCS server on a CentOS machine. FreeBSD users may find this guide (external) more useful. Installing Fossil To be able to use the latest Fossil version, we're going to install it from the source. Installing compile-timed requirements Fossil can use zlib and openssl (for HTTPS access). It can also be extended through a pseudo-macro mechanism using Tcl scripting language. Install all of them to enable all features -don't worry! They require only a tiny space and don't drag in a jungle of dependencies. # yum install zlib zlib-devel tcl tcl-devel openssl openssl-devel Compiling and installing fossil Obtain Fossil source from Fos...

What Is Enterprise Resource Planning (ERP)?

Image
Demystifying Enterprise Resource Planning softwares and explaining the concepts in plain English. No matter if you're an executive officer, IT consultant, software developer or a business manager, you've heard people talk about ERP in meetings and sessions.  And probably a half-dozen of ERP providers have already come knocking at your office door to present their products. No doubt that you have spent hours searching the Internet on what exactly is an ERP and how can it help an organisation.  But if you're still in doubt, this writing may help you.  I'll try to explain the golden characteristics of an ERP in a simple language; so please bear with me. The Definition ERP is an integrated, business process oriented and best practice based information system that helps managers better understand the situation of their organisations. So a software that is called an ERP is: Integrated Business process oriented Best practice based and its ultimate goal is to help ma...

Good vs. Bad & Ugly: Comprehensive vs. General Design

Image
The difference between "Comprehensive Software Design" and "General Software Design" and why Comprehensive is the only way. Let's assume a simple categorisation of business into trade and manufacturing. Most of the companies that are active in a category, arrange and manage their processes - despite different fields of business- inspired by a similar and close to optimal pattern.  For example all trade companies share the same processes and concepts such as sales region, sales commission, petty cash and etc.  The pattern is called best practice . Good Now, imagine that you have designed and implemented information software for 25 trade companies so far; naturally resulting in your extensive knowledge of trade firms' processes and requirements -put simply, best practice.  In other words, you do know what the customer wants and needs. What happens if you decide to design a comprehensive information system for trade firms? As you know their requirements...

Amailyser: The E-mail Analyser

Introducing a small software to analyse a mailbox. Recently Ed Daniel (a friend of mine) needed to produce a time analysis report out of his e-mails and asked if I can help him.  Well, obviously I said yes. I thought to myself, he needs charts and graphs and data querying from many aspects that I may not know.  So to me the best option is to load his e-mail important fields into an RDBMS (such as SQLite or PostgreSQL).  Later he can do whatever he wants with the data using reporting tools such as JasperReports and produce nice charts and graphs as he requires. That was the motivation to write Amailyser (github repo) . The language is Python 2.x; I could have done it in Perl but I'm learning Python and it seems like a wonderful practice to me. For DB interaction I used SQLAlchemy a nice ORM mapper for Python. To read the e-mail messages I used Python standard library mailbox. After downloading and extracting, you can run the Amailyzer (after you have modified con...