Return-Path: X-Original-To: apmail-incubator-directmemory-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-directmemory-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 BC13372C0 for ; Fri, 14 Oct 2011 11:19:06 +0000 (UTC) Received: (qmail 81638 invoked by uid 500); 14 Oct 2011 11:19:06 -0000 Delivered-To: apmail-incubator-directmemory-dev-archive@incubator.apache.org Received: (qmail 81616 invoked by uid 500); 14 Oct 2011 11:19:06 -0000 Mailing-List: contact directmemory-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directmemory-dev@incubator.apache.org Delivered-To: mailing list directmemory-dev@incubator.apache.org Received: (qmail 81608 invoked by uid 99); 14 Oct 2011 11:19:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 11:19:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of raffaele.p.guidi@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-wy0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Oct 2011 11:19:00 +0000 Received: by wyh5 with SMTP id 5so3051963wyh.6 for ; Fri, 14 Oct 2011 04:18:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=S2Ctno9s8rdyhUO2elDz50F0TnsJbtld34TqDt3pWIQ=; b=N+/qenKV/TY0XkXuaz5WykDYwCukaws7eXxrusPdkMLmWO87M/P1DqbzDDbzvuQgpE Hg4ehTrFuklJXUMACSGhPTkHrdcJBBDfAoeL20KPdn0hdnMas3Tdxaq1h+i/riw9cPfG odKqYQXg9FZtThAM3L970PyVTeW42vZtlXz0s= MIME-Version: 1.0 Received: by 10.216.220.161 with SMTP id o33mr2612298wep.92.1318591119714; Fri, 14 Oct 2011 04:18:39 -0700 (PDT) Received: by 10.216.74.84 with HTTP; Fri, 14 Oct 2011 04:18:39 -0700 (PDT) In-Reply-To: References: Date: Fri, 14 Oct 2011 13:18:39 +0200 Message-ID: Subject: Re: Objects instead of String Parameters From: "Raffaele P. Guidi" To: directmemory-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=0016364d26114b6c5904af406bf0 X-Virus-Checked: Checked by ClamAV on apache.org --0016364d26114b6c5904af406bf0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable My personal(and professional) point of view is: one thing is designing i.e. a Pointer object which holds the data that is handled by our system (our domain model), one thing is designing the Object Model of the parameters that has to be passed to every single function. I feel, and my experience confirms it, that this could easily lead to over-architecturing. OO is an approach, not a tax ;) Ciao, R On Fri, Oct 14, 2011 at 10:23 AM, Daniel Manzke < daniel.manzke@googlemail.com> wrote: > Hi guys, > > I just wanted to take the chance to discuss one thing with you. > > (similar to the Getter- and Setter-Hell) > > In the last years, I saw several APIs (like you guys too). In my Company = we > started one year ago, to use speaking Classes for Parameters. > This means if I have a Method with 3 String Parameters, I only know what > they mean, if I have the JavaDoc. I really had this case. That's why we > started to use small (no getter and setter beans) classes. Like for the o= ur > login-Method we we are using login(Username, Password) or known from othe= rs > login(Credentials). > > We don't try to force it, because it doesn't make sense in every situatio= n. > ;) > > Another one is the using of One Object as a Parameter. (like the > login(Credentials)) This allows you to evolve your API without breaking t= he > Compatibility, because you could add now Parameters, define them with > Default-Values, so every body can use them, if needed, but old > Implementations are also working. > > What do you think? What's your way? > > Bye, > Daniel > > -- > Viele Gr=FC=DFe/Best Regards > > Daniel Manzke > --0016364d26114b6c5904af406bf0--