-
Notifications
You must be signed in to change notification settings - Fork 4
/
ideas.txt
37 lines (28 loc) · 2.14 KB
/
ideas.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@GrainSchema is currently required, but extend TypePolicy to allow other ways of discovering grain schemas without
having to rely on the annotation. Doing so would allow object model authors to not need a dependency on grains-core.
Unfortunately, this means utility functions that currently rely on the annotation would need to be parameterized
with the customized TypePolicy, which may not be easily available, particularly in a serialization context.
consider adding options to allow:
- setters return void or chaining
- generate WITH methods or don't
- generator should be told what nullable, notnullable annotations to use during setup. same for validation annotations?
- cached hashcodes or not
- brackets on next line or same line
- all collections should default to empty versions, rather than null.
- create observer/observable pattern to hook into building via the builders
-- what would this mean for the with* methods? invoke the observers with the new grain instance?
- include type name in .toString: "Foo{id=234}"
- assert vs. actual type check in the type transformers
any method that is not a getter on the schema can have the implementation injected into it, via the factory.
a plugin to detect backwards and forwards compatibility issues with schema changes, like clirr
$KEYS array should probably be sorted for binary lookup. makes containsKey faster. this would work except for
the special case where the id prop occurs first.
override containsKey in each GrainImpl to improve performance. Implement containsKey, containsValue, and containsEntry
on each Grain and Builder?
Add appendTo(Appendable a) on the GrainImpls, maybe even the builders?
need a way to get the original GrainSchema class from a grain or builder impl.
need a way to get the factory from any GrainSchema.
need a way to get getter/setter/wither name from a GrainProperty.
BoundGrainProperty extends GrainProperty. It has a get method, maybe even a with method. Encapsulates a GrainProperty
and a grain instance. Perhaps use runtime bytecode generation to create direct invocations of the underlying grain's
getters and with accessors. nameProperty.get(); nameProperty.with("Bob");