From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4DuB-0005hR-Cb for qemu-devel@nongnu.org; Thu, 15 Sep 2011 11:31:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4DuA-0001xL-8E for qemu-devel@nongnu.org; Thu, 15 Sep 2011 11:31:11 -0400 Received: from mail-gw0-f46.google.com ([74.125.83.46]:46095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4DuA-0001xH-2q for qemu-devel@nongnu.org; Thu, 15 Sep 2011 11:31:10 -0400 Received: by gwb15 with SMTP id 15so3322815gwb.33 for ; Thu, 15 Sep 2011 08:31:09 -0700 (PDT) Message-ID: <4E721A37.5020605@codemonkey.ws> Date: Thu, 15 Sep 2011 10:31:03 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E70EC90.8000904@us.ibm.com> <4E719F7C.10700@redhat.com> <4E71FD19.6050606@codemonkey.ws> <4E71FF3E.9040008@redhat.com> <4E72093B.5060703@codemonkey.ws> <4E720CBD.2060806@redhat.com> In-Reply-To: <4E720CBD.2060806@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Plan for moving forward with QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Jan Kiszka , qemu-devel , Markus Armbruster , Gerd Hoffmann , "Edgar E. Iglesias" On 09/15/2011 09:33 AM, Paolo Bonzini wrote: > On 09/15/2011 04:18 PM, Anthony Liguori wrote: >> I think there are two real discussions happening here. One is how to >> model and one is what is the right representation of that modelling. >> >> I think Paolo is strongly advocating a non-OO model that uses the >> command pattern to establish most of the relationships. Maybe one level >> of inheritance is used just to provide the right infrastructure for the >> objects to have properties but that's inheritance for functionality >> verses modelling. >> >> I'm advocating a strict OO model. I'm not normally a fan of OO based >> design but I think it fits a device model pretty well because it's such >> a concrete hierarchy. All of the objects we create really correspond to >> real world objects and the inheritance relationships are pretty darn >> obvious. When you're holding a PCI NE2000 card in your hand, there's >> simply no doubt that it is-a PciDevice. > > I think it's in the eye of a beholder. Hold a PCI NE2000 and E1000, they're > clearly both PciDevices, but also they clearly both have PciConnectors. > > Write a driver for a PCI and ISA NE2000, and then they're clearly both NE2000, > but also they clearly both have an NE2K chip. Are we just bike shedding then? Since both models can be expressed by the same infrastructure, does it really matter which model is the One True Right Model? I think this might be a better discussion to have during conversions. IOW, what makes sense for PCI, what makes sense for ISA, etc. Regards, Anthony Liguori