장 성훈

장 성훈

1610944380

웹개발 기초편 - HTML5 required & pattern 사용하기

웹개발 기초편 - HTML5 required & pattern 사용하기

#html5

What is GEEK

Buddha Community

웹개발 기초편 - HTML5 required & pattern 사용하기
장 성훈

장 성훈

1610944380

웹개발 기초편 - HTML5 required & pattern 사용하기

웹개발 기초편 - HTML5 required & pattern 사용하기

#html5

Samanta  Moore

Samanta Moore

1623835440

Builder Design Pattern

What is Builder Design Pattern ? Why we should care about it ?

Starting from **Creational Design Pattern, **so wikipedia says “creational design pattern are design pattern that deals with object creation mechanism, trying to create objects in manner that is suitable to the situation”.

The basic form of object creations could result in design problems and result in complex design problems, so to overcome this problem Creational Design Pattern somehow allows you to create the object.

Builder is one of the** Creational Design Pattern**.

When to consider the Builder Design Pattern ?

Builder is useful when you need to do lot of things to build an Object. Let’s imagine DOM (Document Object Model), so if we need to create the DOM, We could have to do lot of things, appending plenty of nodes and attaching attributes to them. We could also imagine about the huge XML Object creation where we will have to do lot of work to create the Object. A Factory is used basically when we could create the entire object in one shot.

As **Joshua Bloch (**He led the Design of the many library Java Collections Framework and many more) – “Builder Pattern is good choice when designing the class whose constructor or static factories would have more than handful of parameters

#java #builder #builder pattern #creational design pattern #design pattern #factory pattern #java design pattern

Seamus  Quitzon

Seamus Quitzon

1601479980

Confused With Java Singleton Design Pattern? Have a Look at This Article.

What Is a Singleton Design Pattern?

  1. Singleton design pattern allows us to create only one instance of a class and make sure that there exists only one Object in JVM.
  2. Singleton class must have a public static method to get the instance of the class from anywhere in the application [from different classes, different packages, etc].
  3. Singleton class must have a private constructor to instantiate the object of the class.
  4. Singleton class must have a private static variable of the same class which is the only reference of the class[basically this variable will point to only Object of class].

Image for post

Singleton Design Pattern

All these different implementation methods lead to one goal that is having a single instance of a class at any given point of time in JVM. Let’s see different implementation approaches for the Singleton design pattern


1. Eager Initialization :

  1. This is the simplest implementation of the singleton design pattern class. In this method, the private static variable of the same class [reference] is assigned the object of class at the time of loading the class into the JVM memory.
  2. This type of implementation is applicable to the scenarios when we always want the instance of the class.

Let’s see the program to understand this …

package com.vikram;

	public class EagerSingleton {
	    //Only object created when class is loaded and theInstance is private static var pointing to it.
	    private static EagerSingleton theInstance = new EagerSingleton();

	    //private constructor
	    private EagerSingleton(){

	    }
	    //public method to return single instance of class .
	    public static EagerSingleton getInstance(){
	        return theInstance;
	    }
	}

Eager Initialization

#desing-pattern #classloading #singleton-pattern #singleton-design-pattern #java-singleton-pattern

Joseph  Murray

Joseph Murray

1623924649

Overview Of Prototype Desing Pattern

What is Prototype Design pattern?

prototypes design pattern allows you to create objects by cloning an existing object instead of creating a new object from scratch. This pattern is used when the process of object creation is costly. when cloning, the newly copied object contains the same characteristics as its source object. After cloning, we can change the values of the new object’s properties as required. This pattern comes under a **creational **pattern.

For easier understanding, Assume that a database operation should be done in order to create an object. This database call is both time-consuming and costly. we need to create multiple objects. As a result, when we create a new object, each time a database call will occur, this will give a performance flop, right? As a result, initially, we create one object and clone it each time when we required a new object. This will cut down the database calls for each object creation.

#java-design-pattern #cloning #prototype-design-pattern #java #prototype-pattern #overview of prototype desing pattern

Janis  Smitham

Janis Smitham

1626782520

How to Create HTML5 Videos - Introduction and Learn HTML5 and CSS3

Want to learn HTML5 and CSS3 from scratch?

This is the 21st episode of my “Learn HTML5 and CSS3” course. In this course, we will learn everything about how we can create markup for a website. At the end of the course, I will add some full tutorials where I will be creating famous websites from scratch. So, if you have any suggestions, just let me know and I might make a video about it!

In this video, I want to insert a video inside an HTML page in two different ways. The first way will be creating a new folder in our root folder where we will place our video, then we will be using the video element to add the video.

The second way is by using an iFrame from YouTube. This will let us upload a video from an external source.

#css3 #html5 #html5 videos