If you follow the principles of designing OO, then both of them are true. The second option is known as a coordinating object and helps prevent tampering and disruption to the state of your API / Core (no matter what name you want).
The first option is how it is stored internally, and you can optionally allow access to the database server property if you want to allow it.
My own preference would be to restrict any setters to 4 objects and force it through the coordination / facade object ( facade template ). Let the Server offer its databases as a property, etc. Down the chain.
As indicated, the Server.Databases property can be heavy. In this case, it can be accessed through the coordination object (facade).
So:
GetServers() GetDatabases(Server) GetColumns(Database)
etc.
source share