[Engine-devel] Disk BE very small refactoring
Maor Lipchuk
mlipchuk at redhat.com
Tue May 28 10:49:46 UTC 2013
I think the main problem is that we abuse the business entity to act as
an O/R mapping class to the DB and also to be used as a business entity
for presentation purposes.
I understand how Yair thought isPlugged could be fetched from vmDevice,
this is a confusing design, and it is just one example and more to come.
I suggest that if we already thinking of changing the class hierarchy,
we can start by implementing a package for presentation classes for
transient classes such as this instead enforcing complex hierarchy.
The query class will fetch all the data from the DB and initialized the
transient class and send it to the client.
I think it could be a good start and will solve many issues we might
encounter in the future.
Regards,
Maor
On 05/28/2013 11:24 AM, Omer Frenkel wrote:
>
>
> ----- Original Message -----
>> From: "Yair Zaslavsky" <yzaslavs at redhat.com>
>> To: "Vered Volansky" <vered at redhat.com>
>> Cc: engine-devel at ovirt.org
>> Sent: Monday, May 27, 2013 6:22:58 PM
>> Subject: Re: [Engine-devel] Disk BE very small refactoring
>>
>> Vered,
>> VmDevice has "isPlugged" field,
>> Why not have somehow in your inheritence (either Disk or a subclass) a field
>> : "VmDevice device"
>
> disk id is the device id, no need for field to represent the relation.
> the combination of disk-id and a specific entity (vm/template) will get you the other info
>
>> and have isPlugged method called "device.isPlugged()" ?
>>
>> Then you can also add the readOnly property which is not represented at
>> VmDevice.
>>
>>
>> Does this sound logical to you?
>>
>> ----- Original Message -----
>>> From: "Vered Volansky" <vered at redhat.com>
>>> To: engine-devel at ovirt.org
>>> Sent: Monday, May 27, 2013 6:18:58 PM
>>> Subject: [Engine-devel] Disk BE very small refactoring
>>>
>>> Hi All,
>>>
>>> Please express your opinion if you have any -
>>>
>>> Currently Disk BE has a plugged property, which should be a property of the
>>> relationship between vm(or template) and a disk.
>>> I plan to remove this property from the Disk entity, and add new entity,
>>> called DeviceDisk.
>>> This should inherit from Disk and contain the vm/template guid and the
>>> plugged property at first round.
>>> At second round it'll also contain the readOnly property, for RO disks, TBD
>>> right after.
>>>
>>> Appreciate any input,
>>> Vered
>>> _______________________________________________
>>> Engine-devel mailing list
>>> Engine-devel at ovirt.org
>>> http://lists.ovirt.org/mailman/listinfo/engine-devel
>>>
>> _______________________________________________
>> Engine-devel mailing list
>> Engine-devel at ovirt.org
>> http://lists.ovirt.org/mailman/listinfo/engine-devel
>>
> _______________________________________________
> Engine-devel mailing list
> Engine-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/engine-devel
>
More information about the Devel
mailing list