Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should be able to attach configurer to assembly before or after activation #344

Closed
jasperblues opened this issue May 2, 2015 · 4 comments

Comments

@jasperblues
Copy link
Member

  • Typhoon 3.0 has assembly implementing the TyphoonComponentFactory protocol.
  • Before activation these methods raise an exception.
  • After activation they forward to the underlying factory.

In the the case of attaching a configurer this is not the ideal behavior. Before activation it should register an infrastructure definition for the configurer. This would avoid unload/load of singletons.

@jasperblues jasperblues added the bug label May 2, 2015
@etolstoy etolstoy self-assigned this Nov 6, 2015
@etolstoy etolstoy added the debate label Nov 6, 2015
@etolstoy
Copy link
Contributor

etolstoy commented Nov 6, 2015

I've investigated the problem a bit and see the following decisions:

  • We can store all of the pre-attached infrastructure definitions in a separate collection - and return them to the TyphoonComponentFactory in the method:
- (NSArray *)definitions {
    return [[_definitionBuilder builtDefinitions] arrayByAddingObjectsFromArray:_preattachedInfrastructureDefinitions];
}
  • We can add new methods to the current assembly in runtime using the class_addMethod - and (probably 😄) they would be processed just like the normal ones.

@jasperblues , what's your point?

@jasperblues
Copy link
Member Author

@jasperblues , what's your point?

Do you mean:

  • 'What was the rationale for the feature"?
  • Which approach do I prefer?

@etolstoy
Copy link
Contributor

etolstoy commented Nov 6, 2015

@jasperblues The both questions - but mostly the second one.

@jasperblues
Copy link
Member Author

I don't recall what my point was. I think while writing an integration test with Typhoon I tried to attach config incorrectly.

Between the two implementations I think the first is adequate and simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants