Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-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 9E367C4B9 for ; Thu, 10 May 2012 08:24:55 +0000 (UTC) Received: (qmail 16725 invoked by uid 500); 10 May 2012 08:24:55 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 16700 invoked by uid 500); 10 May 2012 08:24:55 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 16686 invoked by uid 99); 10 May 2012 08:24:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 08:24:54 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2012 08:24:49 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4A8OSJi016737 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 10 May 2012 04:24:28 -0400 Received: from dhcp-29-121.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q4A8OPnw021306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 May 2012 04:24:27 -0400 Date: Thu, 10 May 2012 10:25:25 +0200 From: Michal Fojtik To: dev@deltacloud.apache.org Subject: Re: [PATCH core 03/32] Core: Added wrapper for autoloading collections Message-ID: <20120510082525.GA93411@dhcp-29-121.redhat.com> References: <1334670011-40658-1-git-send-email-mfojtik@redhat.com> <1334670011-40658-3-git-send-email-mfojtik@redhat.com> <1336609085.2686.25.camel@avon.watzmann.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1336609085.2686.25.camel@avon.watzmann.net> User-Agent: Mutt/1.5.21 (2011-07-01) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Virus-Checked: Checked by ClamAV on apache.org On 05/10/12, David Lutterkort wrote: > On Tue, 2012-04-17 at 15:39 +0200, mfojtik@redhat.com wrote: > > From: Michal Fojtik > > [ I am looking at your branch, but it's more convenient to reply to > individual patches ] > > This and 2/32 seem like a little too much magic to me; why do this > rather than have a big server.rb ? It's 1200 lines right now, but they > are fairly boring code, and I like being able to see all that code at > once. Sorry, I was too fast with replying ;-) You are referring to the collection subfolder not to lazy-loading. My thoughts was to make it more readable and structured when it will be splitted into separate files. Having everything in one place is nice but when you first look into the server.rb it honestly looks like a mess :-) IMHO having the collections in separate files will make it more easy to fix things in particular collection, without making people rebasing and fixing conflicts in one big server.rb. Also since this code use Base class from Sinatra, all collections are just 'modules' that can be plugged and un-plugged as needed. So you can for example use DC as base for your application where you choose just collections you really want to use. Another thing is that I guess in future we will need to add more collections, like for managing networks/etc so the amount of code in server.rb will eventually grow. I think that for the people that want to add new collection to Deltacloud, it's now more easy just 'copy' the collection file, rename it and add their stuff there. -- Michal -- Michal Fojtik Sr. Software Engineer, Deltacloud API (http://deltacloud.org)