Uploaded image for project: 'PUBLIC - Liferay Documentation'
  1. PUBLIC - Liferay Documentation
  2. LRDOCS-5816

"SERVICES IN JSF" article recommends poor practice for using custom services

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 7.0.x, 7.1.x
    • Component/s: JCP and Faces
    • Labels:
      None

      Description

      The Services In JSF article makes the following recommendation:

      You can create a service.xml file and run Service Builder in your JSF project to build services.

      This is actually not recommended for JSF projects. Instead JSF developers should generate custom services as separate API and Impl jars which should be deployed as individual modules to Liferay Portal.

      The Faces WAR can then rely on the API module as a <scope>provided</scope> dependency.

      Among other things, the main benefit of this practice is to allow multiple WARs to utilize the same custom service API without packaging it inside every WAR's WEB-INF/lib folder. This practice also enforces a separation of concerns or modularity between the UI layer and service layer of a system.

      The article should probably contain an additional section detailing how to deploy an example service (or it should link to this information) and how to add the dependency to a developer's Faces project.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                7.0.x
                7.1.x