JSF is specification or framework?

5

In the JavaEE GitHub there is the repository javaserverfaces-spec that in its README.md says:

  JavaServer Faces (JSF) is the JCP Standard technology for authoring component based user interfaces on the Java EE platform. This particular GitHub project hosts the official JSF specification issue tracker. There are two implementations of the JSF specification, both of which developed with OSI approved Open Source licenses.

Already the Wiki of the tag says:

  

JavaServer Faces (JSF) is a Model-View-Controller framework commonly used to create web applications. Always tell: What is the JSF version you are using; What technology are you using, JSP or Facelets; Error messages displayed; Minimum copy of code that can be executed.

In the Tag Wiki you have a Wikipedia link , which says:

  

JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for web applications. It has an event-driven programming model, abstracting the details of event manipulation and component organization, allowing the programmer to focus on the logic of the application.

I also found this article from the 2005 Oracle Technology Network that says:

  

One of the key advantages of JSF is that it is both the Java Web user-interface standard as well as a framework that firmly follows the Model-View-Controller (MVC) design pattern.

After reading these articles / sources I did not understand two things:

  • Is JSF a specification or framework?

  • JSF is MVC?

  • asked by anonymous 19.07.2017 / 17:20

    1 answer

    1

    Good question!

    In fact JSF by definition is actually a specification.

    So why do we treat it as a framework when we refer to it? This is due to Java's development and deployment method.

    But how come?

    By default, when you are developing a Java program, JDK provides a set of tools that are packaged by default in the Java JDK. However such tools are not enough (or very crude) to meet all the needs encountered.

    Because of and for other reasons, the Java Community Process , which is actually a kind of community whose purpose is to propose, create and validate new specifications for the Java language. Any member of this community can implement any of these available specifications, which means that when a specification is created it may have several different implementations (and with different stakeholders) that do basically the same thing (with small possible differences).

    But what does this have to do with JSF?

    Everything! JSF currently has two widely used implementations: Mojarra (Oracle) and MyFaces (Apache).

    But wait, there's one more factor to consider when looking at this:

    Implementations do not work "standalone" or "alone", you need an application server to run these implementations. That's where servers such as GlassFish, WildFly, and Tomcat come in. Each of these servers chooses an implementation available to run, just look in their documentation that you will find this information.

    Now if we stop to analyze, neither the specification nor the implementation nor the application servers are really a framework. However, all these factors together with the final product together with its extensive documentation make JSF refer to a framework, mainly because of the way end developers work with it, and also thanks to external libraries such as PrimeFaces, BootsFaces, ButterFaces and etc (these are frameworks because they work a layer above pure JSF to make the development process easier).

    So, it is very difficult to refer to JSF without defining it as a framework. In my opinion, when we refer to JSF more informally, so much to say that it is a framework or specification, what really matters is to know a little of its history and to use it to help us with the problems of day-to- day.

        
    09.08.2017 / 15:12