marimerllc / cslajs Goto Github PK
View Code? Open in Web Editor NEWCSLA for JavaScript
License: Other
CSLA for JavaScript
License: Other
We need a way to define rules and incorporate them into the BO lifecycle. That is:
We may be able to handle this with functions, or create a OO rule design similar to what's in .NET
We need a way to track when properties change so we'll know when to fire rules and change metastate on a BO (e.g. isSavable, isDirty, isNew, etc.)
One whiteboard approach:
public class Stuff : BusinessBase {
public get x(): int {
return this.getProperty("x");
}
public set x(val: int) {
this.setProperty("x", val);
}
}
Where getP/setP would be defined on the base class. Unfortunately all TS/JS supports is the notion of public and private, so these methods would have to be public for the subclass to call them.
It may be possible to take advantage of JS's dynamic nature to only add properties to a private collection if the developer has called the getP/setP. This would allow the dev to not have to define a private backing field and let CSLA handle that. A problem may be if the property doesn't have a defined backing field yet, so what would "return this.getProperty("x");" do for an int? Even with generics in TypeScript we probably won't have enough information at runtime to synthesize the property correctly. So we may end up with this:
public class Stuff : BusinessBase {
private _x: int;
public get x(): int {
return this.getProperty("x", "_x");
}
public set x(val: int) {
this.setProperty("x", "_x", val);
}
}
For this issue, only define the metastate properties and change them with setProperty(). Rules (business + authorization) will be addressed later (so no broken rules collection as of yet).
This would include DP and Child insert, update, and delete (+ deleteSelf?) methods, as well as a save() method.
Just the create and fetch out of BusinessBase.
Need these types so devs can create rich object hierarchies that will work similar to the .NET versions.
A fair amount of DP operations need to be asynchronous. Using promises is what we should use - we need to figure out the best approach here (i.e. use a library to support this, create our own that's compliant, etc.)
Need to prove how serialization of classes works in ES6.
I took a look at the csla.js file and it had tests and a bunch of stuff into it. Yet there is also a test project. I like what a lot of projects are doing and that is placing a .spec.js file right next to the file that contains the tests. This tests right next to the file and the tooling can pick it up via a wild card. Also, It's kind of hard to track what's transpiled and what isn't when viewing the source.
Create a configuration object (+ interface) that will be passed to a DataPortal instance to determine how things will work, like:
Define a node implementation that will respond to DP operations, process them appropriately, and return values back as needed. Note that we may follow the convention in CSLA.NET to have one "get" operation for every DP call and differentiate each based on parameters (e.g. create, fetch, insert, update, delete, execute)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.