Bug 175680 - [api][breaking] ISystemRegistry API should be cleaned up
Summary: [api][breaking] ISystemRegistry API should be cleaned up
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0.1   Edit
Hardware: All All
: P2 enhancement (vote)
Target Milestone: 2.0   Edit
Assignee: Martin Oberhuber CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: api
Depends on: 175262 177128 186773 189123
Blocks: 170922
  Show dependency tree
 
Reported: 2007-02-27 06:14 EST by Martin Oberhuber CLA
Modified: 2008-08-13 13:20 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2007-02-27 06:14:48 EST
ISystemRegistry contains lots of methods for getting hosts, systemTypes or subsystemConfigurations based on various query criteria. Many of these are redundant, but some important ones are missing. The API should be cleaned up:

1. API docs should specify that ISystemRegistry is not intended to be
   implemented or subclassed by clients.
2. There should be one clearly defined and documented API method for getting
   the ISystemRegistry (currently: RSEUIPlugin, RSECorePlugin, SystemStartHere, 
   SystemRegistry).
3. The actual SystemRegistry implementation should be internal. This will
   require returning a proper interface in RSEUIPlugin.
4. All methods taking a system type name as parameter should be deprecated,
   and replaced by methods taking an IRSESystemType instance:
   - getHostsBySystemType(IRSESystemType), 
   - getSubsystemConfigurationsBySystemType(IRSESystemType)
5. Wherever there are duplicate methods get... with a variant taking an 
   interface (e.g. ISystemProfile) and a name (e.g. profileName), there 
   should be only ONE method in the API, preferrably taking the interface.
   Clients who have a name and need to query something from the Registry
   should then do something like
      ISystemProfile profile = registry.getProfileByName(name);
      IHost[] hosts = registry.getHostsByProfile(profile);
6. There should be methods
   - getSubsystems(IHost host, Class subsystemInterface) 
   - getSubSystemConfigurations(IHost host, Class subsystemInterface)
   in order to simplify or make obsolete corresponding implementations in
   RemoteFileUtility, RemoteCommandHelpers. The method would be analogous
   to the current getServiceSubSystems() method. An empty subsystemInterface
   parameter (null) could be used to replace the current getSubsystems(IHost)
   and getSubSystemConfigurations(IHost) methods.
Comment 1 Martin Oberhuber CLA 2007-05-25 10:34:38 EDT
As of 2.0RC1,
* Items 1-4 are completed.
* For Item 5: many methods have been marked deprecated, 
  scheduled for deletion in RC2.
* For Item 6, getSubsystems(IHost host, Class subsystemInterface) 
  has been implemented.

getSubSystemConfigurations(IHost host, Class subsystemInterface) does not 
really make sense, because in order to fulfill the query, all
subsystemConfigurations would need to be instantiated. It's better to get
all subsystems for the given interface, and the use the subsystem to 
redirect to the subsystemConfiguration instead.
Or, query the subsystemConfigurations by plugin.xml specified category
or id instead.

Committers please review the methods deprecated in ISystemRegistry and let me know if I should keep any of these. Otherwise, they will be deleted in RC2.
Comment 2 Martin Oberhuber CLA 2007-06-05 11:42:21 EDT
Discussed on committer meeting 5-jun-2007:
take out all the deprecated methods.
Comment 3 Martin Oberhuber CLA 2007-06-05 12:35:08 EDT
Removed deprecated methods:
[175680] Deprecate obsolete ISystemRegistry methods

This finishes work on this item.
Comment 4 Martin Oberhuber CLA 2008-08-13 13:20:08 EDT
[target cleanup] 2.0 RC2 was the original target milestone for this bug