VMware {code} Community
red888
Contributor
Contributor

What is the difference between the View and ManagedObjectView?

Im reading the docs for the API reference.

It looks pretty straight forward, but Im a little confused about the purpose of ManagedObjectView.

According to the docs:

ViewManager can be used to create "Views" (ContainerViewListViewInventoryView). So ViewManager is like a View factory right?

What confuses me though is that if View is the base class then why do the ContainerView, ListView, InventoryView actually extend from ManagedObjectView which in turn extends from View?

What is ManagedObjectView's purpose? Why don't they extend directly from View? With my limited understanding of this I see ManagedObjectView as a weird middleman.

Reply
0 Kudos
1 Reply
joshames
Enthusiast
Enthusiast

In the description it explains it to you.  View is the base class for any view.  ManagedObjectView is the base class for views that provide access to ManagedEntity objects.  Managed Entity is the base type for ALL objects in the inventory tree, ie: vm's, datastores, clusters, etc.  To answer your question, I don't know why they decided to build a managed object view off of view and base everything off of that and I doubt you will find your answer here unless one of the vSphere developers is on here browsing.  But what I would guess is that since ManagedObjects are the base of almost everything in vSphere SDK, they created the managedobject view to correlate directly with managed objects and provide specific properties that are available with managed objects...I doubt the view base class would have those properties.

 

Josh

Reply
0 Kudos