Return-Path: X-Original-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltaspike-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A66699821 for ; Fri, 5 Oct 2012 17:58:15 +0000 (UTC) Received: (qmail 5813 invoked by uid 500); 5 Oct 2012 17:58:15 -0000 Delivered-To: apmail-incubator-deltaspike-dev-archive@incubator.apache.org Received: (qmail 5780 invoked by uid 500); 5 Oct 2012 17:58:15 -0000 Mailing-List: contact deltaspike-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltaspike-dev@incubator.apache.org Delivered-To: mailing list deltaspike-dev@incubator.apache.org Received: (qmail 5772 invoked by uid 99); 5 Oct 2012 17:58:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 17:58:15 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeanouii@gmail.com designates 209.85.223.175 as permitted sender) Received: from [209.85.223.175] (HELO mail-ie0-f175.google.com) (209.85.223.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2012 17:58:10 +0000 Received: by mail-ie0-f175.google.com with SMTP id c13so4712894ieb.6 for ; Fri, 05 Oct 2012 10:57:49 -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; bh=A4o5b9scZK0x5iBzX5tT3IO4/ldT4/u75YiI6/IcgnQ=; b=S3xCemS5G0388gdymxq+EIq6zAmJh0MyXzxXleOPCAKPlcyWlQ8kOvrdcnG+ksjDG/ 2ths9NTe6IMevvTzLZULCt2x+F6F6tfDTNGqMR8feThx2ut4sXa9q5sSGQf0uHr32p+5 PjrGQWG4yTlhyaS/1TftI9wK2cKCxPSnBBN8X5q2sy0D/B/YwVMqZg/rMUWIkEtByGbu FEuYHmqXwkTfb88pjXBoQi5hyYS7XbGqLQgqkCp+w5ogQ7kBu1MH+biwqbn/ASznNlyA nTWzCU/Ky+KFXN1ODngAI+oLGkl+Bz3bs6VJbK+C8cl19UzfW4XPhnsXUUMkySyNUDnU XG2Q== MIME-Version: 1.0 Received: by 10.50.194.132 with SMTP id hw4mr1888813igc.35.1349459869825; Fri, 05 Oct 2012 10:57:49 -0700 (PDT) Received: by 10.64.24.165 with HTTP; Fri, 5 Oct 2012 10:57:49 -0700 (PDT) In-Reply-To: <1349457868.27068.YahooMailNeo@web28902.mail.ir2.yahoo.com> References: <1349457868.27068.YahooMailNeo@web28902.mail.ir2.yahoo.com> Date: Fri, 5 Oct 2012 19:57:49 +0200 Message-ID: Subject: Re: proposal for JSF Messages From: Jean-Louis MONTEIRO To: deltaspike-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=14dae93411e92dfa5e04cb539c01 X-Virus-Checked: Checked by ClamAV on apache.org --14dae93411e92dfa5e04cb539c01 Content-Type: text/plain; charset=ISO-8859-1 Hi Mark, That's more or less the same spirit of the typed logger which is in my opinion really useful. For example, I like how it has been defined in Seam Solder. Using the same idea for messages is also relevant in my opinion even if I don't like your example with the logger ;-) Indeed, IMHO the logger level should be defined in the typed logger itself to make it consistent all over the application (i.e.. you should not be able to define a different level each time you wanna use a message). Then, getting the message only without producing a log is useful and can be an option to the typed logger. Jean-Louis 2012/10/5 Mark Struberg > Hi folks! > > I thought quite some time about how we could do the typesafe messging for > JSF. Today I had the following idea. > > > Imagine a typesafe message > > @MessageBundle > public interface SimpleMessage > { > @MessageTemplate("Welcome to %s") > Message welcomeTo(String name); > } > > This is nice but it's hard to use it for creating FacesMessages that way. > > Now imagine the following > > @Inject > JsfMessage message; > > ... > > message.addInfo().welcomeTo("DeltaSpike); > > > > public interface JsfMessage { > T addInfo(); > T addWarning(); > T addError(); > void clear(); > } > > > I think it is possible to implement this, right? > > Wdyt from a users perspective? > > LieGrue, > strub > > --14dae93411e92dfa5e04cb539c01--