Skip to main content

Posts

Getting started with Micronaut using Gradle

Getting started In this tutorial, we will create a Micronaut application using Gradle. Github Link What you will need Java installed on your machine Gradle installed on your machine Text Editor Steps First create your project folder, we will make a folder called "micronaut-project" for this tutorial. The second step is to add the build.gradle  file inside the project folder. This will contain a script to build the Micronaut application. Now update the build.gradle file. 1. Add following plugin plugins { id( "com.github.johnrengelman.shadow" ) version "7.1.1" id( "io.micronaut.application" ) version "3.2.0" } This will help to build application executable jars.        2. Next, add dependencies. dependencies { annotationProcessor( "io.micronaut:micronaut-http-validation" ) implementation( "io.micronaut:micronaut-http-client" ) implementation( "io.micronaut:micronaut-jackson-databind" )

Abstract Factory design pattern analysis

What is the Abstract Factory design pattern?   The intent or definition of Abstract Factory is “ Provide an interface for creating families of related or dependent objects without specifying their concrete classes ” It's a bit of a complicated definition, so we'll need to break it down into meaningful chunks to understand it. 1.  " Provide an interface "  When we discuss the Abstract Factory, we are referring to interfaces rather than abstract classes. Essentially, this design pattern provides us with an interface, similar to those found in Java, C#, or Typescript (abstract class).   Why interface?  Whenever we talk about any design pattern, we focus on how we will use it rather than how we will implement it. Because a concrete class creates tight coupling, whereas an interface isolates it from the rest of the system, an interface is always the better choice. We can get different solutions at runtime without having to update our code.

AngularJs Tutorials : Bootstrap

Every application starts with bootstrap process which initialize application and wire it other with dependencies and configurations. AngularJs is not different from other application. It also starts application with bootstrap process. Following operation happens inside AngularJs bootstrap process. Load application module. Create dependency injector and load dependencies. Compile HTML and create scope for application. All these steps happens inside angular.js scripting file. therefore we need to include it first. we can include it inside HEAD tag or at end of BODY tag. Note: Adding angular.js file at end of body tag will allow browser to load of HTML elements without any delay and afterwards load angular.js and begin bootstrapping process. You can get angular.js source file from https://code.angularjs.org/ <script src= ”https://code.angularjs.org/1.3.0/angular.js” type= ”text/javascript” > AngularJs bootstrap process happens on docum

MongoDB Tutorials : Aggregation Framework

MongoDB Aggregation Framework groups set of documents together and performs certain operation on this grouped documents and returns results in the form of documents. MongoDB aggregation answer to those query which requires grouping of documents. Aggregation framework works on three type of model Aggregation pipeline Map Reduce Single Purpose Aggregation Operations Now let see how MongoDB Aggregation Framework works with simple example. Suppose you are MongoDB application developer in a respected company and you have been given a MongoDB database that holds information about human population which is distributed according to cities and their states. here is one sample document. { "city" : "ACMAR" , "loc" : [ - 86.51557 , 33.584132 ], "pop" : 6055 , "state" : "AL" , "_id" : "3500

PHP Tutorials : Autoload PHP Classes

With some examples, this tutorial post will teach the PHP autoloader and namespace concepts. What is Autoloading in PHP? PHP autoload's primary function is to load PHP files into the application context. The import statement is the default method to include PHP file into context. However, we may avoid the issue by using the PHP autoload capability to autoload essential PHP files, which keeps your code clean and composable. Why do we need auto loading? When creating object-oriented applications, many developers create one PHP source file per class declaration. One of the major inconveniences is having to start each script with a huge list of required includes. Autloading allows us to include an arbitrary number of PHP files in the application context if they aren't already included by other include statements.  PHP Autoloading Methods PHP uses two functions; one is the magic method spl_autoload_register  and the other is   __autoload . Although __autoload has been

Subscribe for latest tutorial updates

* indicates required