Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Pattern for DOS/console + Entity(ejb3)

 
Ranch Hand
Posts: 2107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Help please?

For jee, if front end is jsp/servlet, I would say, roughly:

JSP -- (servlet controller) -- session bean (processor) -- entity beans

How about for the one I mentioned in the title? [DOS/console + Entity(ejb3) ]
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • JSP - Presentation Tier
  • Session bean - Business Tier
  • Entity - Integration Tier



  • I would say the console view is the presentation layer.
    What is stopping you from using a session bean in the console case? Maybe you are referring to this?

  • Console - Presentation Tier
  • POJO - Business Tier
  • EJB3 (Hibernate?) support - Integration Tier



  • If you want to hide the POJO EJB support interaction introduce a "workspace" persistance abstraction layer - this is where you would build your POJO repositories on. See Chapter 6: Preparing for Infrastructure

    That way you end up with:

  • Console - Presentation Tier
  • POJOs, Repositiories, Services - Business Tier
  • Workspace PAL, EJB3 support - Integration Tier

  •  
    Jesus Angeles
    Ranch Hand
    Posts: 2107
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I did not dismiss the possibility of using a session bean. I was just totally unsure of what pattern/style/design to use in this scenario.

    It is probably a common scenario. It is just new to me.

    The jsp-servlet-session bean-entity that I mentioned, most likely is based on the front controller patter; that is why there is an extra 'servlet/controller' mentioned.

    For this console system, is it like below? lets say I have 2 subsystems, Payment and Reservation:

    Payment presentation -- pojo Payment business class -- Payment processor/session bean -- entity

    Reservation presentation -- pojo Reservatioin business class -- Reservation processor/session bean -- entity
     
    Jesus Angeles
    Ranch Hand
    Posts: 2107
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Or possibly:

    ================================================================
    Payment presentation -- pojo Payment controller -- Payment business/session bean -- entity

    Reservation presentation -- pojo Reservatioin controller -- Reservation business/session bean -- entity
    ================================================================
     
    Peer Reynders
    Bartender
    Posts: 2968
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The problem isn't here that the console view is that much different from a JSP view - they are both in the presentation layer. You are still trapped in the pre-EJB3 thinking of J2EE.

    The session bean is often nothing but a Transaction Script and the entity is nothing but an objectified database table or EQL/SQL query cursor row. This isn't very object-oriented even though everything is an Object.

    When you are working with POJOs the objects represent actual domain concepts that often require composite database rows and/or composite objects - POJOS are persistence ignorant (PI). In Domain Driven Design (DDD) terminology a POJO is an Entity if it has an identity - otherwise it is a Value Object (e.g. the Java Integer class). Usually each type of Entity POJO (or set of closely coupled POJOs) has its own Repository which is responsible for the management of the entities and the repository interacts with the persistance abstraction layer - there is no equivalent to J2EE entity beans. Business functionality that isn't covered by either the DDD Entities or Repositories is usually moved to Service.

    So the confusion has less to do with console versus JSP but more with POJO Domain objects versus the pre-EJB3 way of doing things.
     
    Peer Reynders
    Bartender
    Posts: 2968
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    more like:

    ================================================================
    Payment transaction presentation -- Payment Repository -- persistence abstraction layer (work space using EJB3)

    Reservation transaction presentation -- Reservation Repository -- persistence abstraction layer (work space using EJB3)

    -- Credit Card Verification Service -- CC abstraction layer
    ================================================================

    Transaction in the context of your domain rather than a database or distributed transaction.
    [ October 21, 2007: Message edited by: Peer Reynders ]
     
    Jesus Angeles
    Ranch Hand
    Posts: 2107
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks. I will share here once it is done. Ill post my design, and we can comment on it.
     
    Jesus Angeles
    Ranch Hand
    Posts: 2107
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I didnt have time to improve my design. It is a small school homework.

    It turned out, that there is another front end to the same heart - web.

    DOS/Console----------------X session bean(transaction script)-----ejb3 persistence
    JSP---servlet(processor)---X session bean(transaction script)-----ejb3 persistence

    Both frontends communicated with the same X session bean.
    [ November 04, 2007: Message edited by: Jesus Angeles ]
     
    Thanks tiny ad, for helping me escape the terrible comfort of this chair.
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
      Bookmark Topic Watch Topic
    • New Topic