pf4j/pf4j: Plugin Framework for Java (PF4J)

Lightweight Plug-In-Based Application Development

pf4j/pf4j: Plugin Framework for Java (PF4J)

We have compiled a list of 50 awesome plugins: we have split all of the plugins into the following categories: Web design web development news, website design and online marketing. Web design, development, javascript, angular, react, vue, php, SEO, SEM, web hosting, ecommerce, website development and search engine optimization, social media management.

Web Application Framework or simply “web framework” is a software framework that is designed to support the development of web applications including web services, web resources and web APIs. Frameworks are, in short, libraries that help you develop your application faster and smarter!

Nowadays, the number of Web Frameworks have increased greatly. To help you pickup the most suitable one for your Web Application, we have compiled a list of 10 best frameworks available online, in your preferred language.

  1. Ruby on Rails

Ruby on Rails is an extremely productive web application framework written by David Heinemeier Hansson. One can develop an application at least ten times faster with Rails than a typical Java framework. Moreover, Rails includes everything needed to create a database-driven web application, using the Model-View-Controller pattern.

 Language : Ruby

Latest Version : Rails 5.0.0.beta2

Framework Link: http://rubyonrails.org

Github Link : https://github.com/rails/rails

Websites using Rails : GroupOn , UrbanDictionary , AirBnb , Shopify , Github

  1. Django

Django is another framework that helps in building quality web applications. It was invented to meet fast-moving newsroom deadlines, while satisfying the tough requirements of experienced Web developers. Django developers say the applications are it’s ridiculously fast, secure, scalable and versatile.

Language : Python

Latest Version : Django 1.9.2

Framework Link: https://www.djangoproject.com

Github Link : https://github.com/django/django

Websites using Django : Disqus , Pinterest , Instagram , Quora

  1. Angular(previously Angular JS)

Angular is a framework by Google (originally developed by Misko Hevery and Adam Abrons) which helps us in building powerful Web Apps. It is a framework to build large scale and high performance web application while keeping them as easy-to-maintain. There are a huge number of web apps that are built with Angular and can be found here https://www.madewithangular.com

Language : JavaScript

Latest Version : Angular 7.1.5

Framework Link: https://angular.io/

Github Link : https://github.com/angular/angular

Websites using Angular: Youtube on PS3 , Weather , Netflix

  1. ASP.NET

ASP.NET is a framework developed by Microsoft, which helps us to build robust web applications for PC, as well as mobile devices. It is a high performance and lightweight framework for building Web Applications using .NET.  All in all, a framework with Power, Productivity and Speed.

Language : C#

Latest Version : ASP.NET 5 (ASP.NET Core 1.0)

Framework Link: http://www.asp.net/

Websites using ASP.NET : GettyImages , TacoBell , StackOverflow

  1. METEOR

Meteor or MeteorJS is another framework which gives one a radically simpler way to build realtime mobile and web apps. It allows for rapid prototyping and produces cross-platform (Web, Android, iOS) code. Its cloud platform, Galaxy, greatly simplifies deployment, scaling, and monitoring.

Language : JavaScript

Latest Version : Meteor 1.2.1

Framework Link: https://www.meteor.com/

Github Link : https://github.com/meteor/meteor

Websites using Meteor : HaggleMateWishPool , Telescope

  1. Laravel

Laravel is a framework created by Taylor Otwell in 2011 and like all other modern frameworks, it also follows the MVC architectural pattern. Laravel values Elegance, Simplicity, and Readability. One can rightaway start learning and developing Laravel with Laracasts which has hundreds of tutorials in it.

Language : PHP

Latest Version : Laravel 5.2

Framework Link: https://laravel.com/

Github Link : https://github.com/laravel/laravel

Websites using Laravel : Deltanet Travel , Neighbourhood Lender

  1. Express

Express or Expressjs is a minimal and flexible framework that provides a robust set of features for web and mobile applications. It is relatively minimal meaning many features are available as plugins. Express facilitates rapid development of Node.js based Web applications. Express is also one major component of the MEAN software bundle.

Language : JavaScript

Framework Link: http://expressjs.com/

Github Link : https://github.com/strongloop/express

Websites using Express : Storify , Myspace , LearnBoost

  1. Spring

Spring, developed by Pivotal Software, is the most popular application development framework for enterprise Java. Myriads of developers around the globe use Spring to create high performance and robust Web apps. Spring helps in creating simple, portable, fast and flexible JVM-based systems and applications.

Language : Java

Latest Version : Spring 4.3.0

Framework Link: http://projects.spring.io/spring-framework/

Github Link : https://github.com/spring-projects/spring-framework

Websites using Spring : Mascus, Allocine

  1. PLAY

Play is one of the modern web application framework written in Java and Scala. It  follows the MVC architecture and aims to optimize developer productivity by using convention over configuration, hot code reloading and display of errors in the browser. Play quotes itself as “The High Velocity Web Framework”

Language : Scala and Java

Latest Version : Play 2.4.6

Framework Link: https://www.playframework.com/

Github Link : https://github.com/playframework/playframework

Websites using PLAY : LinkedIn, Coursera, LendUp

  1. CodeIgniter

 CodeIgniter, developed by EllisLab, is a famous web application framework to build dynamic websites. It is loosely based on MVC architecture since Controller classes are necessary but models and views are optional. CodeIgnitor promises with exceptional performance, nearly zero configuration and no large-scale monolithic libraries.
Language : PHP

Latest Version : CodeIgnitor 3.0.4

Framework Link: https://codeigniter.com/

Github Link : https://github.com/EllisLab/CodeIgniter

Websites using CodeIgnitor : Bufferapp, The Mail and Guardian

Apart from these 10 frameworks, others like Symphony , Ember.js, Sails.js, React.js are also worth mentioning. Which framework would you prefer for your Web Application and why? Let us know in the comment section below.

Article By Harshit Gupta:
Kolkata based Harshit Gupta is an active blogger having keen interest in writing about current affairs, technical Blogs, stories, and personal life experiences. Besides passionate about writing, he also loves coding and dancing. Currently studying at IIEST, he is an active blog contributor at geeksforgeeks. 

If you also wish to showcase your blog here,please see GBlog for guest blog writing on GeeksforGeeks.

Article Tags :

The Plug-in Development Environment (PDE) provides tools to create, develop, test, debug, build and deploy Eclipse plug-ins, fragments, features, update sites and RCP products. PDE also provides co…

Tools, Application Development Frameworks, EclipseRT Target Platform Components, Web, XML, Java EE and OSGi Enterprise Development

Last Updated on Tuesday, October 22, 2019 — 11:36 by Paul Verest

§

Breaking the code, with iizi platform based on Eclipse

Mindus simplifies the digital transformation for coders, made by people who like to code. Discover iizi, our platform that changes the basi…

Application Development Frameworks, IDE, Mobile and Device Development, Build and Deploy, Application Server

Last Updated on Tuesday, October 22, 2019 — 11:36 by Christopher Mindus

§

§

Based on Dynamic Web Project facets,Provider XML script language,Good design component have appropriate size,You can assembly application quickly with XML script(like ant).And support hot deploymen…

IDE, J2EE Development Platform, Application Management, Application Development Frameworks, Build and Deploy

Last Updated on Monday, February 4, 2019 — 13:50 by hu zhiman

§

DaVinci supports a wide variety of open source frameworks such as jQuery Mobile, KnockOut, Underscore, Handlebars, Backbone, etc. to aid you in HTML5 web app development. And we keep updating – the…

Application Development Frameworks

Last Updated on Friday, June 13, 2014 — 07:21 by Alfred Heu

§

§

A powerful suite of components for embedding secure user authentication into web, desktop, and mobile apps. Supports OAuth, NTLM, RADIUS, Kerberos, SAML, LDAP, Certificate Management, and more.

Application Development Frameworks

Last Updated on Thursday, August 15, 2019 — 17:46 by Drew Dalton

§

A set of tools to optimize the creation and maintainability of JUnit tests.

Write less, test more! The main feature of JUnit-Tools is to generate JUnit test-elements (packages, classes, methods,…

Tools, Testing, Application Development Frameworks, Code Management, Source Code Analyzer

Last Updated on Tuesday, October 22, 2019 — 11:31 by JUnit-Tools Team

§

Two wizards:

1. Modeling Workspace Wizard — generates modeling, feature, repository, parent, and aggregator projects ready to be built with Maven/Tycho.
2. Application Workspace Wizard — same a…

Systems Development, Application Development Frameworks, Modeling, Web, XML, Java EE and OSGi Enterprise Development

Last Updated on Tuesday, October 22, 2019 — 11:32 by Pavel Vlasov

§

The PFGrid-Toolkit provides fast and flexible widgets for SWT/JFace, especially an SWT-Grid-widget which allows TreeList- and Table-mode. The rendering is done by renderer-classes: XPTreeListRender…

UI, Entertainment, Graphics, Editor, Tools

Last Updated on Sunday, May 27, 2012 — 17:29 by Missing name Mising name

§

Build, execute, and analyse complex test scenarios with the full-featured integrated test development and execution environment (IDE) TTworkbench. This powerful, user-friendly tool allows you to te…

Documentation, Application Development Frameworks, Languages, IDE, Editor

Last Updated on Thursday, August 31, 2017 — 09:56 by Katrin Boening

17.

Tu, M.T., Griffel, F., Merz, M., Lamersdorf, W.: A Plug-in Architecture Providing Dynamic Negotiation Capabilities for Mobile Agents. In: Proceedings of the Second International Workshop on Mobile Agents, MA’ 98, Stuttgart, Germany. Lecture Notes in Computer Science, Vol. 1477. Springer-Verlag (1998) 222–236

Google Scholar

Components

  • Plugin is the base class for all plugins types. Each plugin is loaded into a separate class loader to avoid conflicts.
  • PluginManager is used for all aspects of plugins management (loading, starting, stopping). You can use a built-in implementation as JarPluginManager, ZipPluginManager, DefaultPluginManager (it’s a JarPluginManager ZipPluginManager) or you can implement a custom plugin manager starting from AbstractPluginManager (implement only factory methods).
  • PluginLoader loads all information (classes) needed by a plugin.
  • ExtensionPoint is a point in the application where custom code can be invoked. It’s a java interface marker.
    Any java interface or abstract class can be marked as an extension point (implements ExtensionPoint interface).
  • Extension is an implementation of an extension point. It’s a java annotation on a class.

PLUGIN = a container for EXTENSION POINTS and EXTENSIONS lifecycle methods (start, stop, delete)

A PLUGIN is similar with a MODULE from other systems. If you don’t need lifecycle methods (hook methods for start, stop, delete) you are not forced to supply a plugin class (the PluginClass property from the plugin descriptor is optional).

Demo

Demo applications are available in demo folder

Documentation

Documentation is available on pf4j.org

How to use

It’s very simple to add pf4j in your application.

Define an extension point in your application/plugin using ExtensionPoint interface marker:

publicinterfaceGreetingextendsExtensionPoint {

    StringgetGreeting();

}

Create an extension using @Extension annotation:

@ExtensionpublicclassWelcomeGreetingimplementsGreeting {

    publicStringgetGreeting() {
        return"Welcome";
    }

}

Create (it’s optional) a Plugin class if you are interested for plugin’s lifecycle events (start, stop, …):

publicclassWelcomePluginextendsPlugin {

    publicWelcomePlugin(PluginWrapperwrapper) {
        super(wrapper);

        // you can use "wrapper" to have access to the plugin context (plugin manager, descriptor, ...)
    }

    @Overridepublicvoidstart() {
        System.out.println("WelcomePlugin.start()");
    }

    @Overridepublicvoidstop() {
        System.out.println("WelcomePlugin.stop()");
    }
    
    @Overridepublicvoiddelete() {
        System.out.println("WelcomePlugin.delete()");
    }
    
}

In above code I created a plugin (welcome) that comes with one extension for the Greeting extension point.

You can distribute you plugin as a jar file (the simple solution). In this case add the plugin’s metadata in MANIFEST.MF file of jar:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: decebal
Build-Jdk: 1.6.0_17
Plugin-Class: org.pf4j.demo.welcome.WelcomePlugin
Plugin-Dependencies: x, y, z
Plugin-Id: welcome-plugin
Plugin-Provider: Decebal Suiu
Plugin-Version: 0.0.1

In above manifest I described a plugin with id welcome-plugin (mandatory attribute), with class org.pf4j.demo.welcome.WelcomePlugin (optional attribute), with version 0.0.

Now you can play with plugins and extensions in your code:

publicstaticvoid main(String[] args) {
    ...// create the plugin managerPluginManager pluginManager =newJarPluginManager(); // or "new ZipPluginManager() / new DefaultPluginManager()"// start and load all plugins of application
    pluginManager.loadPlugins();
    pluginManager.startPlugins();

    // retrieve all extensions for "Greeting" extension pointList{amp}lt;Greeting{amp}gt; greetings = pluginManager.getExtensions(Greeting.class);
    for (Greeting greeting : greetings) {
        System.out.println("{amp}gt;{amp}gt;{amp}gt; "  greeting.getGreeting());
    }
    
    // stop and unload all plugins
    pluginManager.stopPlugins();
    pluginManager.unloadPlugins();
    
    ...
}

The output is:

{amp}gt;{amp}gt;{amp}gt; Welcome

PF4J is very customizable and comes with a lot of goodies. Please read the documentation to discover yourself the power of this library.

Quickstart (call to action)

  1. Read this file to have an overview about what this project does
  2. Read Getting started section of documentation to understand the basic concepts
  3. Read Quickstart section of documentation to create your first PF4J-based modular application

Read Next

Masonite 2.0 released, a Python web development framework
Is web development dying?
Meet Sapper, a military grade PWA framework inspired by Next.js

What are the benefits of using Fusion.js?

On top of the benefits of a pre-configured, optimized boilerplate, Fusion.js also provides a flexible plugin-based architecture which makes it appropriate for building single-page applications and web apps that depend on complex service layers to meet quality requirements.

Понравилась статья? Поделиться с друзьями:
Website Name