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 B69F3EA1A for ; Sun, 26 May 2013 18:46:55 +0000 (UTC) Received: (qmail 88595 invoked by uid 500); 26 May 2013 18:46:55 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 88436 invoked by uid 500); 26 May 2013 18:46:55 -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 88409 invoked by uid 99); 26 May 2013 18:46:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 May 2013 18:46:54 +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: domain of simone.tripodi@gmail.com designates 209.85.214.169 as permitted sender) Received: from [209.85.214.169] (HELO mail-ob0-f169.google.com) (209.85.214.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 May 2013 18:46:48 +0000 Received: by mail-ob0-f169.google.com with SMTP id up14so769041obb.28 for ; Sun, 26 May 2013 11:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=yUtsmPaj+RqX7kxsQoc4Q1Ou5gRo4+It+wQl1mV+thI=; b=BM+PR62bo6CJwMjZnwCz8OPk4vTztyy129UpyrIGFR6Xvue6XRucssbk0K3e1iyEWZ FdUPwuw5OmVcZDkZmF1chF3A7Wgb729i4NAl98GRff6Nr4QAK5pdsD870skOdPAEbSI7 667+SzLYJssWkxwQavkdCQvXG4PmV0p1nPIhldu4zv0tEqSte8XUVsJM4Mo3dqcveeEL NbliGscVbcOOR0DReOBdetvzWBMaW9yQyPHhi04KSu933KTPMMyRp7WF6kBjZyW2yNvN 4mSbXnVk+Xbvs8dhCeMP0hhjSayKbwv8RJ8OEXPWzP3xba/ojPCsJufbxQUrE/hVrPTs IqKQ== MIME-Version: 1.0 X-Received: by 10.60.142.7 with SMTP id rs7mr17018349oeb.106.1369593987006; Sun, 26 May 2013 11:46:27 -0700 (PDT) Sender: simone.tripodi@gmail.com Received: by 10.60.37.135 with HTTP; Sun, 26 May 2013 11:46:26 -0700 (PDT) In-Reply-To: <0fa9e6f2faa4e433e2fcc628bb2a6677@cs.helsinki.fi> References: <0fa9e6f2faa4e433e2fcc628bb2a6677@cs.helsinki.fi> Date: Sun, 26 May 2013 20:46:26 +0200 X-Google-Sender-Auth: gy2MoF46vlzBpCudAx4roSeDJZ4 Message-ID: Subject: Re: [Graph] the future of commons-graph and modularization From: Simone Tripodi To: Commons Developers List Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi Rodion, > > Might the API look like this? > [...] more or less :) Introducing kind of "PathFinder" interface, as main entry point for shortest path algorithms, but keeping the current chin builders - as you notice, `withEuristhic` makes sense for A* only, when current fluent interfaces drive users on choosing the right algorithm, with right inputs, via a "state-machine" which is clever than a simple builder pattern. Anyway > > This would seem like eliminating the need for CommonsGraph -monolith at the > cost of introducing new interfaces/abstract base classes for every type of > algos out there, plus the actual implementation classes implementing the > API. you got the idea, nice to see we are on the same path!!! :) I'll prepare a more concrete proposal in a branch, hope to read reviews from your side! :) All the best, -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ On Sun, May 26, 2013 at 6:10 PM, Rodion Efremov wrote: > Simone Tripodi kirjoitti 26.05.2013 18:35: > >> Hi all, mates, >> >> after a long while I haven't touched commons-graph, I had the >> opportunity to get influenced by some activities at my paid work that >> made me think twice on what as been already done in that component, >> and would like to bring new experiences in. >> >> So, what I still like about it: >> >> * graph APIs: the use of generics make the usage of graphes >> extensible and adaptable; >> >> * fluent APIs: this is the most powerful feature IMHO that simplifies >> the APIs usage; >> >> What I *don't* like anymore: >> >> * poor modularization: commons-graph is ATM a big fat monolith; >> >> * one single entry-point; for each new family of algorithm(s), new >> methods have to be added in the main Commons-Graph class. >> >> What I would like to propose to work _in a separated branch_, is >> trying to split the big monolith in smaller modules and separate APIs >> from related implementation as much as possible. >> >> Questions are: >> >> * WDYT? :) > > > Might the API look like this? > > public interface PathFinder { > public Path search(); > public PathFinder from( V source ); > public PathFinder to( V target ); > public PathFinder withHeuristic( HeuristicFunction f ); > // for A* search. > } > > ... and then we would have, say, A* as follows: > > public class AStarFinder implements PathFinder { > public Path search() { > // A* magic here. > } > > ... implement the rest. > } > > ... with usage as follows: > > Path path = new AStarFinder().withHeuristic( myFunkyHeuristic > ).from( source ).to( target ).search(); > > This would seem like eliminating the need for CommonsGraph -monolith at the > cost of introducing new interfaces/abstract base classes for every type of > algos out there, plus the actual implementation classes implementing the > API. > >> * About release process: would it be acceptable, here in commons, >> release a single module - the only one that has been changed, I mean - >> without releasing the whole project? >> >> * In case the answer to previous question is "no", would it make >> sense moving commons-graph to the Incubator (and possibly to TLP)? >> >> TIA, all the best! >> -Simo >> >> http://people.apache.org/~simonetripodi/ >> http://simonetripodi.livejournal.com/ >> http://twitter.com/simonetripodi >> http://www.99soft.org/ >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org >> For additional commands, e-mail: dev-help@commons.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org