Cheesegrate is a centralized place to model the data in your application, and generate a variety of representations of it. Model once, use often.
Picture an iOS app backed by an a Java backend, persisting to Cassandra.
You model your data, something like
class User(BaseModel):
name = StringField()
is_followed = BooleanField()
profile_pic_small = UrlField()
From this data model, you could
- Generate Objective-C data model classes that use Mantle
- Generate Java (POJO) data model classes for use in the backend
- Generate JSON fixtures, populated with random or sequential data using a rich Factory syntax
- Generate Gatling Scala scripts that exercise the app's REST endpoints
- Generate unit tests that verify HTTP authentication/authorization rules are working
- Generate a Objective-C data controller that exercises the REST, exposing methods like
[dataController getUsersWithSuccessHandler:^{ ... }];
- Generate Java validation code using XXX
- Generate Cassandra CQL commands to build the database schema
- Define denormalized data "views" of the data in the datastore. For example imagine two tables, "users by ID" and "users by timestamp".
- Data views need to be synchronized in schema and data. Persisting a single
User
object should automatically update "users by ID" and "users by timestamp". Generate the code to make this happen. - Generate URL routes for the backend
- Generate HTML documentation of the HTTP API, database schemas, and Objective-C models and data controller
class User(BaseModel):
name = StringField()
is_followed = BooleanField()
profile_pic_small = UrlField()
UIntField
FloatField
StringField
BooleanField
UrlField
EnumField
DateField
GUIDField
EmbeddedField
ArrayField
Something like
class UserFactory(Factory):
name = IndexedChoiceField(sequence=user_names_and_pics, seq_index=0)
profile_pic_small = IndexedChoiceField(sequence=user_names_and_pics, seq_index=1)
is_followed = RandomBooleanField()
ChoiceField
IndexedChoiceField
RandomBooleanField
RandomIntField
RandomFloatField
DateNowUTCField
RandomGuidField
ArrayOfModelsField
Classes that describe how to convert
- data model -> Objective-C model class
- data model -> Java model (POJO)
- data model -> Cassandra CQL
etc.