OBJY
An object-driven, cross-platform programming framework, written in JavaScript, that uses behaviour-driven objects for modelling use cases.
Installing
OBJY can be used in Node and the Browser.
Node
npm install objy
Browser
Programming with OBJY
Programming on OBJY is done in two simple steps:
- Define an Object Family (a bucket of objects) an choose how objects in this family are stored, processed and observed.
- Build and handle objects and tell them what to do.
Object Family
//Define Object Family OBJY // OBJY now has the contructors: OBJYobject // as a wrapper for single objectsOBJY // as wrapper for multiple objects
Simple object
//Build an object OBJYobject name: "Passport" properties: expires: "2020-10-10" number: "123"
Object with behaviour
//Build an object OBJYobject ... warnMe: date: "2020-10-05" action: "email('expiring soon!')" onChange: "if(this.number.length == 0) return;"
Add
// add oneOBJYobject{}; // add multipleOBJY;
Get one
OBJYobjectid;
Query
OBJY;
Update
// update oneOBJYobjectid // replace oneOBJY;
Delete
// delete oneOBJYobjectid;
Customize
Objects can be very different in their nature. Some objects are big, some are small, some are produced very vast, some not so fast. When you define an object family, you can tell OBJY where objects in this family are stored, how they are processed and observed, along with other options.
OBJY
Default mappers are already initialized! If you'd like to work in memory, just ignore the mappers section
Mapper types
Type | Explanation |
---|---|
storage |
Storage mappers can be plugged in to define where and how objects in an object family are persistent. |
processor |
Processor Mappers define, how object actions are executed. |
observer |
Observer Mappers define, how object events are observed and time-based actions triggered. |
Authors
- Marco Boelling - Initial author - Twitter
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Connect
- objy.io - OBJY's official website