-
Notifications
You must be signed in to change notification settings - Fork 4
Description
So, currently, if I have some class, I go about applying specific annotations in a source language to create my describable class.
If I have myClass...
public class myClass{
public int myField;
public List<Something> myCollection;
public Composite someComposite;
} I have to know some stuff about annotating DBAL... and additionally, some of those annotations can be determined simply from the type of the field:
public class myClass{
@simpl_scalar
public int myField;
@simpl_collection("someTagName")
public List<Something> myCollection;
@simpl_composite
public Composite someComposite;
} The current model also allows a user to incorrectly annotate a field... this decreases usability in general, and effectively our description api becomes more problematic for a user..
public class myWrongClass{
@simpl_composite
public int thisIsDramaticallyWrong;
}There are a lot of different annotations in the "DBAL". In java, there's:
*bibtex_key.java
*bibtex_tag.java
*bibtex_type.java
*DbHint.java
*Hint.java
*simpl_classes.java
*simpl_collection.java
*simpl_composite_as_scalar.java
*simpl_composite.java
*simpl_db.java
*simpl_descriptor_classes.java
*simpl_exclude_usage.java
*simpl_filter.java
*simpl_format.java
*simpl_hints.java
*simpl_inherit_parent_tag.java
*simpl_inherit.java
*simpl_map_key_field.java
*simpl_map.java
*simpl_nowrap.java
*simpl_other_tags.java
*simpl_scalar.java
*simpl_scope.java
*simpl_tag.java
*simpl_use_equals_equals.java
*simpl_wrap.java
This is a lot of complexity that could be washed away / simpl-ified.
I propose the following:
- We carefully look at all of the annotations presently in the system and eliminate all of them which can be determined from type information; replacing those with a @simpl_field annotation.
- We find a way to add format-specific information in a different way (I'll elaborate more on a proposal to this later; I have a solution but I think 1. is more important)
- Ultimately: We should make simpl annotations as simpl as possible. Where can complexity be cut / simplified / made more general and usable?
Thoughts? @amwebb @andruidk @rhema @quyin
Something more in line with what I'd like to move towards:
public class myClass{
@simpl_field
public int myField;
@simpl_field(tag="something")
public List<Something> myCollection; // will be <my_collection> <something ...> ...
@simpl_field
public Composite someComposite;
}