Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2463C90A7 for ; Wed, 13 Jun 2012 04:13:19 +0000 (UTC) Received: (qmail 42891 invoked by uid 500); 13 Jun 2012 04:13:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 42792 invoked by uid 500); 13 Jun 2012 04:13:15 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 42763 invoked by uid 99); 13 Jun 2012 04:13:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 04:13:14 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of moonblade.wolf@gmail.com designates 209.85.214.173 as permitted sender) Received: from [209.85.214.173] (HELO mail-ob0-f173.google.com) (209.85.214.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jun 2012 04:13:09 +0000 Received: by obbwd20 with SMTP id wd20so317421obb.18 for ; Tue, 12 Jun 2012 21:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=gehpSfYzjDpv8DMfO71RSQhQjyPwlsT6wsl0QWG8jAA=; b=TQwyGjN9aJ8079jjdMVGTw7y7pASh5D8E59HEDXHIZQFCWVzUeYjI2CcrrdVKSTfZa 8kO2d3anIPOIWVwW9H4Kup9N9RI6WG2OVMT5uEgjG9PMUAJvsJaBk8kGJ/TLocl0q8bF 5M9diq/zUkqQyhFr6FCNoaPUpTsmUW1erKhUAFFf5t/vz0SaOBZXTLt1bxo/vj6yuWJL Rw09v1fv2QT7bbuQUt9gzWNyDSRM8zBwV74yVwrYHoE15bUFCyq19FqE1fXo5SgkMkpm AcWwaccDYd1qhQNdhseb1XWNqCR9K+WD479BRzwxPI8hYTfbuw3j1QZVVmxjihRNzFKK IL0Q== MIME-Version: 1.0 Received: by 10.182.36.102 with SMTP id p6mr22735771obj.77.1339560768339; Tue, 12 Jun 2012 21:12:48 -0700 (PDT) Received: by 10.76.18.72 with HTTP; Tue, 12 Jun 2012 21:12:48 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Jun 2012 11:12:48 +0700 Message-ID: Subject: Re: [OT] Observer pattern? From: Albert Kam To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org If you are talking about how to notify other webapps, i think you're actually talking about integration between existing applications here, which can be done using RMI (java only and using a specific port), Hessian/Burlap (support several languages + http, but not java serialization) , or even Spring's HttpInvoker (java + spring + use http). But i think it's more usual for people to just implement web services, either the RESTful way or the SOAP way, which makes use of HTTP (which doesnt normally get blocked by firewall). But if the weight of your question is on the observer pattern, which is kinda like publish / subscribe, for example, publishing change event, and the listener of that type of event will execute some code (perhaps invoking external web services), i suggest you to look at google guava's EventBus code.google.com/p/guava-libraries/wiki/EventBusExplained Updating the view without user intervention is about realtime user experience, which could involve polling or pushing changes. I am not quite familiar in this, but i think polling is about using a smart timer in javascript to fetch any data changes and then update the view appropriately. For pushing data from backend to frontend, perhaps html 5's websocket could do, and perhaps comet also ? On Wed, Jun 13, 2012 at 5:00 AM, Leo Donahue - PLANDEVX wrote: > Could someone point me in the right direction. > > If three different web applications all rely on knowing when a piece of d= ata changes, how does webapp #1 who makes the update, notify webapp #2 and = webapp #3 that they need to make a request to update their view? > > For example: > > User of webapp #1 updates the status of something in a database and needs= to inform the users of webapp #2 and webapp #3, who are updating other dat= a yet watching for that status to change, that they need to update their vi= ew (fetch updated data from a database, or call some other method based on = the changed status value). > > It sounds like the Observer pattern, but I don't know. > > Leo > --=20 Do not pursue the past. Do not lose yourself in the future. The past no longer is. The future has not yet come. Looking deeply at life as it is in the very here and now, the practitioner dwells in stability and freedom. (Thich Nhat Hanh) --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org