Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

PROPOSAL: Change Module syntax #90

Closed
mhevery opened this issue Apr 23, 2014 · 2 comments · Fixed by #91
Closed

PROPOSAL: Change Module syntax #90

mhevery opened this issue Apr 23, 2014 · 2 comments · Fixed by #91

Comments

@mhevery
Copy link
Contributor

mhevery commented Apr 23, 2014

Current API:

value(Foo, new Foo(), withAnnotation: a, visibility: v);
factory(Foo, (i) => new Foo(), withAnnotation: a, visibility: v);
type(Foo, withAnnotation: a, visibility: v);
type(Foo, implementedBy: FooImpl, withAnnotation: a, visibility: v);

I think this syntax would be nicer on the eyes.

bind(Foo, annotatedWith: a, toValue: new Foo(), , visibility: v);
bind(Foo, annotatedWith: a, toFactory: (i) => new Foo(), visibility: v);
bind(Foo, annotatedWith: a, visibility: v);
bind(Foo, annotatedWith: a, toImplementation: FooImpl, visibility: v);
@mvuksano
Copy link
Contributor

+1

pavelgj added a commit to pavelgj/di.dart that referenced this issue Apr 23, 2014
bind(Foo, annotatedWith: a, toValue: new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toFactory: (i) => new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toImplementation: FooImpl, visibility: v);
bind(Foo, annotatedWith: a, visibility: v);

type, value and factory methods are marked as deprecated.

Closes dart-archive#90
pavelgj added a commit to pavelgj/di.dart that referenced this issue Apr 23, 2014
bind(Foo, annotatedWith: a, toValue: new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toFactory: (i) => new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toImplementation: FooImpl, visibility: v);
bind(Foo, annotatedWith: a, visibility: v);

type, value and factory methods are marked as deprecated.

Closes dart-archive#90
@pavelgj
Copy link
Contributor

pavelgj commented Apr 23, 2014

@mhevery Please see #91

pavelgj added a commit to pavelgj/di.dart that referenced this issue Apr 25, 2014
bind(Foo, annotatedWith: a, toValue: new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toFactory: (i) => new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toImplementation: FooImpl, visibility: v);
bind(Foo, annotatedWith: a, visibility: v);

type, value and factory methods are marked as deprecated.

Closes dart-archive#90
pavelgj added a commit to pavelgj/di.dart that referenced this issue Apr 25, 2014
bind(Foo, annotatedWith: a, toValue: new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toFactory: (i) => new Foo(), visibility: v);
bind(Foo, annotatedWith: a, toImplementation: FooImpl, visibility: v);
bind(Foo, annotatedWith: a, visibility: v);

type, value and factory methods are marked as deprecated.

Closes dart-archive#90
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants