Ticket #671 (closed defect: fixed )

Opened 4 years ago

Last modified 3 days ago

Document the differences between t.a.service.IService.disownServiceParent and t.a.service.IServiceCollection.removeService

Reported by: exarkun Assigned to: thijs
Type: defect Priority: high
Milestone: Component: core
Keywords: documentation Cc: exarkun, moshez, thijs
Branch: branches/doc-diff-service-671 Author: thijs
Launchpad Bug:

Attachments

Change History

  2004-08-14 02:57:43+00:00 changed by exarkun

These methods do similar things, and it is not clear which is the correct way
to remove a service from a service collection.  I believe disownServiceParent is
the correct way.  This should be documented clearly.

  2004-08-14 03:05:22+00:00 changed by hypatia

Thanks. As far as I can tell, all of the Service architecture needs far better docs.
Will likely get to this in a couple of weeks.

  2005-08-20 08:53:37+00:00 changed by hypatia

Is removeService deprecated or does it have some internal use?

  2005-08-22 06:16:30+00:00 changed by exarkun

<itamar> disownServiceParent is symmetric with setServiceParent in that it sets
the `parent' attribute on the child, so you probably want to use that and
`removeService' is the hook in the collection that subclasses can override, but
usually you don't call yourself.
It sounds like the code should stay the same and the docs should say something
like the above.

  2006-04-29 22:04:45+00:00 changed by hypatia

  • cc changed from exarkun, moshez, hypatia to exarkun, moshez
  • keywords set to documentation
  • component set to core
  • owner changed from hypatia to edsuom

Re-assigning doc bugs to edsuom.

  2008-08-05 21:24:13+00:00 changed by thijs

  • owner changed from edsuom to thijs
  • status changed from new to assigned
  • branch deleted
  • author deleted

  2008-08-08 05:59:37+00:00 changed by thijs

  • branch set to branches/doc-diff-service-671
  • author set to thijs

(In [24555]) Branching to 'doc-diff-service-671'

  2008-08-08 06:12:36+00:00 changed by thijs

  • cc changed from exarkun, moshez to exarkun, moshez, thijs
  • keywords changed from documentation to documentation, review
  • status changed from assigned to new
  • owner deleted

  2008-08-14 13:20:21+00:00 changed by exarkun

  • keywords changed from documentation, review to documentation
  • owner set to thijs

Mostly (but not entirely) trivial points:

  • use C{} instead of '`
  • symmetric is an adjective; the text should use symmetrically instead because it is modifying a verb (used) and so the adverb form is required.
  • it doesn't make sense to talk about a subclass in the docstring for a method on an interface. it should talk about what an implementation would do, instead.
  • control is non-specific; I think the docstring needs to talk about how an IServiceCollection needs to implement removeService to take a service out of the collection. It would also help if it explained that (perhaps by convention, only? I'm still not completely clear on the intent of the dual API is here) removeService is only responsible for cleaning up state on the IServiceCollection implementation. This is different from IService.disownServiceParent in that disownServiceParent implementations are required (or are they? does convention dictate this? I dunno) to call the IServiceCollection.removeService in addition to cleaning up any state on the IService itself (such as the parent attribute).

Perhaps it would be best to dispense with the text from itamar's suggestion entirely and just say something like Use this API to remove an IService from an IServiceCollection in the docstring for IService.disownServiceParent and something like Only implementations of IService.disownServiceParent should use this method. in the docstring of IServiceCollection.removeService.

  2008-11-04 01:25:17+00:00 changed by thijs

  • status changed from new to assigned
  • launchpad_bug deleted
  • summary changed from [NEED HELP] Document the differences between t.a.service.IService.disownServiceParent and t.a.service.IServiceCollection.removeService to Document the differences between t.a.service.IService.disownServiceParent and t.a.service.IServiceCollection.removeService

  2008-11-04 01:46:54+00:00 changed by thijs

  • keywords changed from documentation to documentation, review
  • owner deleted
  • status changed from assigned to new

Fixes in r25320, up for review.

follow-up: ↓ 13   2008-11-16 13:07:11+00:00 changed by therve

  • keywords changed from documentation, review to documentation
  • owner set to thijs

Great! Small cleanups:

  • remove trailing whitespaces of the file
  • I like to see a bit of indentation after epydoc fields, like this:
    @return: a L{Deferred} which is triggered when the service has
        finished shutting down. If shutting down is immediate, a value can
        be returned (usually, C{None}).
    

Then you can merge.

in reply to: ↑ 12   2008-11-16 15:32:15+00:00 changed by thijs

  • status changed from new to assigned

Replying to therve:

Great! Small cleanups: * remove trailing whitespaces of the file * I like to see a bit of indentation after epydoc fields, like this: @return: a L{Deferred} which is triggered when the service has finished shutting down. If shutting down is immediate, a value can be returned (usually, C{None}).

Addressed these points in r25376

  2008-11-16 15:40:28+00:00 changed by thijs

  • status changed from assigned to closed
  • resolution set to fixed

(In [25377]) Merge doc-diff-service-671: Document the differences between t.a.service.IService.disownServiceParent and t.a.service.IServiceCollection.removeService.

Author: thijs Reviewer: exarkun, therve Fixes: #671

Note: See TracTickets for help on using tickets.