Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA5DF9A00 for ; Sat, 11 Feb 2012 20:19:23 +0000 (UTC) Received: (qmail 89344 invoked by uid 500); 11 Feb 2012 20:19:23 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 89003 invoked by uid 500); 11 Feb 2012 20:19:22 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 88995 invoked by uid 99); 11 Feb 2012 20:19:21 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Feb 2012 20:19:21 +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 (nike.apache.org: local policy) Received: from [193.74.71.28] (HELO sif.is.scarlet.be) (193.74.71.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Feb 2012 20:19:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be; s=scarlet; t=1328991531; bh=GNEwjsE9e8s14IedVvQq29lX3aHXenw7IiLQO0KM7XU=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=YWO2Y8tyuNWuvfFBYETmVbvgPexWnSQKVtetFExdbk9Mb8ManVQ3Pcf02SM3TL2a3 hpjFH7rJ+Y8hTdN5KX2wnDdwTkim21PBYI/pv4jQGW3P0yGZWxp8s8sm3iKVG8kGp6 OqN1+x9aYnspkYynjkhCWkqT1Vw4ZT5GcO1D0bXQ= Received: from mail.harfang.homelinux.org (ip-62-235-229-168.dsl.scarlet.be [62.235.229.168]) by sif.is.scarlet.be (8.14.5/8.14.5) with ESMTP id q1BKIoUX021527 for ; Sat, 11 Feb 2012 21:18:51 +0100 X-Scarlet: d=1328991531 c=62.235.229.168 Received: from localhost (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id 9125F617DD for ; Sat, 11 Feb 2012 21:18:50 +0100 (CET) Received: from mail.harfang.homelinux.org ([192.168.20.11]) by localhost (mail.harfang.homelinux.org [192.168.20.11]) (amavisd-new, port 10024) with ESMTP id GlFRrwCDF6hq for ; Sat, 11 Feb 2012 21:18:47 +0100 (CET) Received: from dusk.harfang.homelinux.org (mail.harfang.homelinux.org [192.168.20.11]) by mail.harfang.homelinux.org (Postfix) with ESMTP id E4F01617B6 for ; Sat, 11 Feb 2012 21:18:47 +0100 (CET) Received: from eran by dusk.harfang.homelinux.org with local (Exim 4.77) (envelope-from ) id 1RwJPD-0000eq-ST for dev@commons.apache.org; Sat, 11 Feb 2012 21:18:47 +0100 Date: Sat, 11 Feb 2012 21:18:47 +0100 From: Gilles Sadowski To: Commons Developers List Subject: Re: [Math] Make everything "Serializable" ? Message-ID: <20120211201847.GQ12351@dusk.harfang.homelinux.org> Mail-Followup-To: Commons Developers List References: <20120210194034.GM12351@dusk.harfang.homelinux.org> <903E7F1AC6BD414A96DBC9D7008AB5E0@BillPC> <4F36342C.9070507@free.fr> <4F365F33.30207@free.fr> <20120211174628.GP12351@dusk.harfang.homelinux.org> <4F36B4ED.5010102@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F36B4ED.5010102@gmail.com> X-Operating-System: Tiny Tux X-PGP-Key-Fingerprint: 53B9 972E C2E6 B93C BEAD 7092 09E6 AF46 51D0 5641 User-Agent: Mutt/1.5.21 (2010-09-15) X-DCC-scarlet.be-Metrics: sif 20001; Body=1 Fuz1=1 Fuz2=1 X-Virus-Scanned: clamav-milter 0.97.1-exp at sif X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Feb 11, 2012 at 07:35:25PM +0100, Thomas Neidhart wrote: > On 02/11/2012 06:46 PM, Gilles Sadowski wrote: > > >[I still have to understand why objects that represent mathematical > >algorithms must be serializable. It is quite possible that I miss somehing > >but a use-case would help. In principle, I'd think that we must provide > >accessors that would enable user code to re-construct any CM object; then > >it's up to the user code to create any "Serializable" object for storing > >those data they want to send over the wire, and reconstruct the CM object > >on the other end...] > > I think you have a good point in general, but the case where this > discussion started is not as clear-cut as this. In fact, many > algorithms in CM are a mixture of data structures and algorithms > bound together using OO paradigms, which may not be always the best > solution. When I mentioned data vs algorithms, I did not mean the "data" (instance variables) that is part of the algorithm which in an OO approach, you bundle together with the methods that operate on them. I think that it is possible to distinguish objects which primarily represent a (user-level) "data" structure from objects that represent algorithms (e.g. something which is aimed a producing a result later on). An example of the former would be an "Array2DRowRealMatrix" (from package "linear"), an example of the latter would be a "Gaussian" (from package "analysis.function"). While it is reasonable (IMO) to expect to serialize a matrix (a "data" structure), it is not so for a "function"; the fact that it can contain instance variables is due to an OO-programming feature, not to the concept itself. > So my conclusion would be to work on improving the code to be more > functional and separate algorithms / data. In the mean time we can > support the users by making their lives easier and support > serialization by default where possible. If somebody has to work on > a use-case that requires more sophisticated methods, well, he/she > will have to find a solution anyway. I would not draw that conclusion. As a Java library, it would not be wise for CM to move away from the OO paradigm. People who choose or use Java are accustomed to this programming style (or, even, like it ;-). Regards, Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org