Skip to content

Commit 232356d

Browse files
committed
doc updates
Signed-off-by: Jeff Lindsay <[email protected]>
1 parent c301690 commit 232356d

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,25 @@ A component-oriented approach to building Golang applications
1111
## Concept
1212

1313
We want to see a world with great "building blocks" where you can quickly build
14-
whatever you want. Simple and composable is not enough, they need to integrate
15-
and hook into each other.
14+
whatever you want. Traditional "composability" is not enough, they need to
15+
integrate and hook into each other.
1616

17-
This library provides the core mechanisms needed to build out a component
18-
architecture for your applications that also extend into an ecosystem of reusable
19-
components.
17+
This library provides the core mechanisms needed to build out a modular and
18+
extensible component architecture for your application, which also extend into
19+
an ecosystem of "drop-in" reusable components.
2020

2121
There are two parts to this package that are designed to work with each other:
2222

2323
* An object registry for interface-based extension points and dependency injection
2424
* A configuration API for settings, disabling objects, and picking interface backends
2525

26-
The API and even core functionality alone doesn't imply how we build components
27-
with this tool. We can formalize much of this in a proper framework project once
28-
we've determined the conventions. Until then, we can focus on examples and our
29-
small but growing library of [standard components](https://github.com/gliderlabs/stdcom).
30-
31-
In the end, this package helps facilitates structuring Go programs into modular and
32-
extensible components that become much more drop-in building blocks than
33-
the usual Go package.
34-
3526
## Example application
3627

3728
See the [example wiki app repo](https://github.com/gl-prototypes/wiki).
3829

39-
By building out [reusable components](https://github.com/gliderlabs/stdcom), a simple wiki with GitHub authentication
40-
could be put together in ~200 lines of Go as a single component.
30+
After building out [reusable components](https://github.com/gliderlabs/stdcom),
31+
a simple wiki with GitHub authentication could be put together in ~200 lines of
32+
Go as a single component.
4133

4234
## Using com
4335

com.go

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// Package com is the user-facing interface to the object registry. Since
1+
// Package com is a user-facing interface to the object registry. Since
22
// the only part of the API you need to use is Register, the rest of the API
3-
// for interacting with an object registry is in its own package. This is used
4-
// by other tooling building around com, for example the config subpackage.
3+
// for interacting with an object registry is in its own subpackage. This is used
4+
// by other tooling built around com, for example the config subpackage.
55
//
66
// When you register an object, it will populate fields based on the com struct
77
// tags used on them. The object will then also be used to populate fields
@@ -14,14 +14,19 @@
1414
// }
1515
//
1616
// In the above example component, it has fields with all three possible struct
17-
// tags. Singleton will pick the first object in the registry that implements
18-
// that interface. You can also use pointers to concrete types, for example to
19-
// other components. Extpoint is going to be a slice of all objects in the
20-
// registry that implement that interface. Config is not populated, but is allowed
21-
// to be populated via the registry API. If you're using the config package, it
22-
// will do this for you and populate it based on configuration. In this case,
23-
// the key would be "DB" and the value could be the name of any registered
24-
// component that implements api.Store.
17+
// tags:
18+
//
19+
// Singleton will pick the first object in the registry that implements that
20+
// interface. You can also use pointers to concrete types, for example to other
21+
// component types.
22+
//
23+
// Extpoint is going to be a slice of all objects in the registry that implement
24+
// that interface.
25+
//
26+
// Config is not populated, but is allowed to be populated via the registry API.
27+
// If you're using the config package, it will do this for you and populate it
28+
// based on configuration. In this case, the key would be "DB" and the value
29+
// could be the name of any registered component that implements api.Store.
2530
package com
2631

2732
import "github.com/gliderlabs/com/objects"

objects/objects.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type Object struct {
2626
reflectValue reflect.Value
2727
}
2828

29+
// New creates a new Object by value and name
2930
func New(v interface{}, name string) *Object {
3031
return &Object{Value: v, Name: name}
3132
}

0 commit comments

Comments
 (0)