Middle Tier for Java and PHP

Discussion in 'Java' started by John, Apr 5, 2006.

  1. John

    John Guest

    Hi,

    Let's say you have a Java SE Application and a PHP Web App that are both
    accessing a database directly. You want to control things more formally
    by using a common middle tier (enforcing things in addition to database
    constraints / sprocs).

    Any experience on what works and/or recommendations?

    Thanks,

    John
    John, Apr 5, 2006
    #1
    1. Advertising

  2. John

    vjg Guest

    Why a common middle tier? What are you trying to control? The database
    itself should be handling commitment control enforcement and your two
    apps should be written with commitment control in mind. It's the
    application that decides things like transaction boundaries, not the DB
    and (probably) not some middle tier.
    vjg, Apr 5, 2006
    #2
    1. Advertising

  3. John

    John Guest

    vjg wrote:
    > Why a common middle tier? What are you trying to control? The database
    > itself should be handling commitment control enforcement and your two
    > apps should be written with commitment control in mind. It's the
    > application that decides things like transaction boundaries, not the DB
    > and (probably) not some middle tier.
    >


    Let's say you have two applications accessing the same database. If you
    implement the transaction boundaries in each of the two applications
    then you have redundancy (and the requirement to enforce consistency
    across both applications).

    If you implement the transaction boundaries in a common middle tier then
    you eliminate the redundancy.

    John
    John, Apr 6, 2006
    #3
  4. John

    vjg Guest

    So, these aren't two different apps? These are two different
    implementations of the same app (or at least the same transactions)?
    vjg, Apr 6, 2006
    #4
  5. John

    Larry Guest

    Sounds like a good place for a java EJB (Enterprise Java Bean), or even
    a POJO (Plain Old Java Object). An EJB can be called from the java
    app, and possibly PHP (although I don't know enough about PHP to say
    this would work) to access the database. Both apps would use the same
    component (EJB's) to do the work.
    Larry, Apr 6, 2006
    #5
  6. John

    John Guest

    vjg wrote:
    > So, these aren't two different apps? These are two different
    > implementations of the same app (or at least the same transactions)?
    >


    They are two different applications. App 1 may carry out transactions in
    the set T1 and App 2 may carry out transactions in the set T2. T2 is not
    equal to T1, but the intersection of T1 and T2 is not empty.

    I've been looking at EJBs to do this (as per Larry's advice), but I have
    to check that they will work with PHP.

    John
    John, Apr 7, 2006
    #6
  7. John

    Alex Hunsley Guest

    vjg wrote:
    > Why a common middle tier? What are you trying to control? The database
    > itself should be handling commitment control enforcement and your two
    > apps should be written with commitment control in mind. It's the
    > application that decides things like transaction boundaries, not the DB
    > and (probably) not some middle tier.


    While it's true that the app is bound to be concerned with some notion
    of transaction boundaries and atomicity etc., it can still make sense to
    have the actual transactional details - the actual graft - dealt with by
    a middle tier.
    Alex Hunsley, Apr 7, 2006
    #7
  8. John

    Alex Hunsley Guest

    John wrote:
    > vjg wrote:
    >> So, these aren't two different apps? These are two different
    >> implementations of the same app (or at least the same transactions)?
    >>

    >
    > They are two different applications. App 1 may carry out transactions in
    > the set T1 and App 2 may carry out transactions in the set T2. T2 is not
    > equal to T1, but the intersection of T1 and T2 is not empty.
    >
    > I've been looking at EJBs to do this (as per Larry's advice), but I have
    > to check that they will work with PHP.


    You can certainly access EJBs from PHP. Here's an article about that:

    http://www.devx.com/Java/Article/21707

    (I've not read this article, so I can't vouch for how good it is)


    I'd read up on pros and cons of EJBs, and the alternatives, before
    diving in. .
    Alex Hunsley, Apr 7, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig Buchanan

    Middle-tier equivalent to server.mappath?

    Craig Buchanan, Jan 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,572
    martin
    Jan 27, 2004
  2. Guadala Harry

    ADO.NET DataReaders and the Middle Tier

    Guadala Harry, Feb 21, 2004, in forum: ASP .Net
    Replies:
    7
    Views:
    784
    Guadala Harry
    Feb 21, 2004
  3. =?Utf-8?B?SWFuIFdpbGxpYW1zb24=?=

    Retrieving state information from a middle tier

    =?Utf-8?B?SWFuIFdpbGxpYW1zb24=?=, Feb 25, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    1,256
    =?Utf-8?B?aW5ldG11Zw==?=
    Feb 25, 2005
  4. Rajive Narain
    Replies:
    0
    Views:
    1,473
    Rajive Narain
    Sep 18, 2009
  5. Replies:
    11
    Views:
    179
    Dr.Ruud
    Jan 6, 2007
Loading...

Share This Page