Skip to main content

Welcome to Geoff Hayward's Weblog

Commenting on Java, JavaFX, Java EE, Joomla, and IoT.

Whilst fixing a defect in this blog's platform I realised that a particular business rule could be moved out of the code; into a database view. The movable business rule was "All posts returned to the front-end should have a published state". This rule extends to include a post's tags. That is "only the tags of a published post should appear in tag summaries".

One way to add this business rule would be to preform a WHERE published = true check in each respective query. The check would be executed by the database but is declared in the code. The declaration of the check is also in many places. I found it is particularly easy to forget to declare the check when joining tables. In the case of the tag summaries the check got over looked in a join between tags and posts.

Another way to add this rule to the platform would be to create a database view that encompasses the rule. Each query that has the aspect would then use the view. The business rule is then given once, declared and executed in the database. The join between tags and posts would then be:

SELECT *
FROM tags t
JOIN published_posts p
[...]

Where 'published_posts' is a database view; not a table.



Read

After several weeks of programming a bespoke blogging platform it's finished. Well kind of finished. I will get to that. The blogging platform is for Web Developers, who need the back-end application part of a platform but do not wish to be tied to one language and template engine for their own front-end development work.

Why the need? I decided to create my new website with Java EE 7. I am a huge fan of Java EE 7 and JSF 2.2. The blogging platform is simply a by-product of that wish.

In the next iteration I intend to crate a REST API so that the front-end can be an authenticated REST client. Thus achieving the goal of language and template engine independence. In the meantime I'm road testing the blog platform with my own website. Once the next iteration is ready I will probably commit the platform to a public GitHub repository. You can find more information about the blog platform over at javablogplatform.blogspot.co.uk/.

Why the new website? My blogging goal has changed since creating the old website. I wish to have more of a weblog. The subject area of this new website will be anything Java EE, Software Development, and MSc study related. I have of course imported the content from my older blog.

So here goes



Read

Mailing List


Responsive Media

With the ResponsiveMedia plugin for Joomla it is easy to add 3rd party content from YouTube, Vimeo, and Instagram right in to any Joomla! article.

ResponsiveMedia