3 Replies Latest reply on Feb 21, 2012 1:30 PM by Jang-Vijay Singh

    Where to put my business logic in an ADF fusion project ? (session bean )

    noechri
      I created an ADF fusion application with a Model project, containing a view object, and a View Project containing a servlet.
      Now i want 'a java object' with a method that will fetch my data from the view, execute some business logic, and returns a result to the servlet, where the method is executed.

      In a non-ADF environment , i would create an EJB session bean, inject this bean in my servlet, and call the method.

      But it seems there are other possibilities when using ADF. Can someone give me a clue in which direction i should work ?

      create my own EBJ project an link it to my view project to use in the servlet : but how do i access the view object of my model in an ejb session bean ?

      or use the java class option in my AppModule that is defined in my model

      or a third option ?

      Keep in mind that the method, containing the business logic, will have a lot of code.

      tnx already for any clues or tips !!!!
      grtz,
      Chris.
        • 1. Re: Where to put my business logic in an ADF fusion project ? (session bean )
          Jang-Vijay Singh
          or use the java class option in my AppModule that is defined in my model
          Yes, Application module is the place where such business logic goes.
          It's roughly the equivalent of your Session bean where you write 'business service' logic.
          • 2. Re: Where to put my business logic in an ADF fusion project ? (session bean )
            noechri
            If i put them in the app moduel ,there is no clear separation between the business logic and the data (=model).
            If i look at the doc's, i think that the java class for the app module is designed to add some extra logic to the business component.

            But when i refer to business rules, i mean a whole bunch of classes and methods that actuatlly do somehting with the data of the business component.
            • 3. Re: Where to put my business logic in an ADF fusion project ? (session bean )
              Jang-Vijay Singh
              If i put them in the app moduel ,there is no clear separation between the business logic and the data (=model).
              I'd beg to differ - I find the separation quite clear and intuitive:
              Entity objects = business domain objects: data + validations - we would traditionally implement these using entity EJB's, hibernate objects etc.
              View Objects = Not exactly J2EE TO's - I find this an abstraction unique to ADF encapsulating the POJO and a query.
              Application Module = the API interface / 'business service'. You write your logic and expose it using any convenient interface - java client, SOAP client, EJB interface etc.

              The MVC (DataBindings - ADFm ; Pages - jsff or jspx ; TaskFlows ADFc) then resides on top of these in your ADF UI project and consumes these business services (or ones from a non ADFbc source).
              If i look at the doc's, i think that the java class for the app module is designed to add some extra logic to the business component.
              Right on.
              But when i refer to business rules, i mean a whole bunch of classes and methods that actuatlly do somehting with the data of the business component.
              Yes, ADF objects in all the layers allow you the flexibility to extend their behaviour in custom java classes.
              1 person found this helpful