Skip to main content


Showing posts from August, 2017

Private Methods In Interfaces In Java 9

Java SE 9 is nearing its release date. At this time we have a fair idea about new features in Java 9. One of the major enhancements is the introduction of Private Methods in Interfaces. Initially, it might be confusing to understand requirement of private methods in an Interface, but let's try to understand it step by step. Pre Java 8 Era In pre Java 8 era, Interfaces were only skeletons to define class structure. They were not allowed to have definition for any method. public interface DBManager{       String USER_NAME = "xyz";       String PASSWORD = "*********";       void save(Employee obj);       void save(Department obj); } This created a situation, where, if we had single behavior for a method, we had to repeat same piece of code in each implementing class. This resulted in lot of redundant code. Another solution was, to use Abstract Class instead of an Interface. This approach had its own obvious problems. Default Methods in Java

New Features of Java 9

Java 9 upgrade is almost ready. Early access builds are already out in the wild, with general availability expected in September 2017. Today we have a very clear picture of what to expect from Java 9 release. If Java 8 was a major release of lambdas, streams and API changes, then Java 9 is all about modules, jshell, and a collection of under the hood and API updates. Let take a quick look at some of the major features in Java 9. 1. Java 9 Module System One of the big changes of Java 9 is the Module System. Oracle Corp is going to introduce their Jigsaw Project. Project Jigsaw’s goal is to make Java modular and break the JRE to inter-operable components. Modular source code is the first out of 4 steps towards Jigsaw and will not change the actual structure of the JRE and JDK. The purpose of this step is to reorganize the JDK source code into modules, enhance the build system to compile modules, and enforce module boundaries at build time. Before Java SE 9 versions

What are variables in SASS?

Sass Variables allow you to define a value once and use it in multiple places. Variables begin with dollar signs and are set like CSS properties. You can change the value of the variable in one place, and all instances where it is used will be updated. When defining a variable we store in it a value, which often reoccur in the CSS like a palette color, a font stack or the whole specs for a cool box-shadow. Also, mostly the variables are defined at a fixed location, like top of the SASS file or in a dedicated separate file. This makes it easy to locate and change the values, instead of searching through the entire stylesheet. Below you can see a simple example, where variables are used to define font, color and shadow. SCSS file: $title -font: normal 24px/1.5 'Open Sans' , sans-serif; $title-color : #F44336; $box -shadow-bottom-only: 0 2px 1px 0 rgba(0, 0, 0, 0.2); h1.title { font: $title -font; color: $ title-color; } div.container { color: $ title-color; bac

Creating Dynamic CSS

While creating a SaaS (Software as a Service) software, a major goal is to allow users to have their own branding on the SaaS software. This specifically means, allowing the users to customize colors and images of the software. Whenever faced with this problem, we start hunting for 'dynamic CSS'. We look for options where we can set values in our CSS stylesheets like colors and image at run-time. However, native CSS technology does not support setting values dynamically. So we come across pre-compilers like SASS and LESS. These pre-compilers support features like variables and rules, but again they do not allow you to change these values at run-time. These pre-compilers are mostly meant to improve organization of your stylesheets and make them easy to maintain. A software that could allow us to set CSS values from database and reflect those changes in real time (of course without any website downtime or re-compilation) would be an ideal solution. This is where GrooveUI c

What is GrooveUI?

GrooveUI is a web service that allows you to easily convert your website into a white labelled offering. GrooveUI allows you to create and apply new website themes in real time. You can manage stylesheet and images of you website on the fly. GrooveUI helps you to convert your SaaS (Software as a Service) software into a white labelled software in minutes. GrooveUI is built over industry trusted SASS(Syntactically Awesome StyleSheets) stylesheets. You only have to upload your SASS files to GrooveUI CDN (not other files) and connect your website to retrieve compiled CSS files from GrooveUI CDN. GrooveUI extracts all the SASS variables from your files and gives you a nice UI to update their values. You can create multiple themes and specify different values for each SASS variable based on Theme. Themes are accessed by specifying 'theme' parameter in your website URL. You can also configure multiple domains and sub-domain and set default theme for each of them. In that case

SASS with GrooveUI

SASS stands for Syntactically Awesome StyleSheets. Sass is a CSS pre-processor with syntax advancements. Style sheets created in SASS syntax are processed by the SASS compiler, and turned into regular CSS style sheets. It allows you to easily manage complex CSS files by using variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of the Compass style library. One of the most powerful features of SASS is the use of variables. Example, instead of repeating the value of your sites primary color at multiple places, you could define a variable for primary color and then use that throughout your stylesheet. SASS compiler will replace the value of variable with actual value while generating CSS. One feature which is left wanting, is the ability to dynamically update these variables, say from database values. This is