
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
A MVC framework for Titanium Developer.
The purpose of this framework is to organize your Titanium Developer projects in a Model-View-Controller (MVC) pattern.
Current Version: 0.3.1
Fixed issue with model generator and the name attribute
From this point on we will not be changing the API to move to stability. There were some changes between 0.2 and 0.3. From this point on there will not be any more api changes, so if your app works with 0.3 it should work with all later versions.
Extended the Chester namespace from Base, this will enable the developer to add multiple applications to the Chester namespace and run routes between the apps.
Created an alias of '_' underscore for find, which will make the lines more readable. ex:
Chester._('app').run(...)
instead of
Chester.find('app').run(...)
Created a names array on the base class to make it easier to find children objects
Updated generators with new changes
Titanium Developer is an awesome JavaScript SDK for building mobile applications, but there are no conventions on how to organize your code. We build web applications using Ruby on Rails, and being able to organize our iPad applications using the same patterns will enable us to process and maintain our software projects more effectively.
Added Helper generator, also changed the convention of the controller actions and model methods to start with an underscore. This will allow us to use new and create without worrying about javascript conflicts.
gem install chester
rake spec
Just run chester install, and it will create the chester.coffee file in your Resources folder.
cd ./Resources
chester install
This command compiles your coffee script into JavaScript.
cd ./Resources
chester brew
cd ./Resources
chester generate model person
chester generate controller people
chester generate view people index
chester generate helper people
These generators will make the following objects:
class Person
# Insert your code here
Chester._('app').Models.add(new Person('Person'))
Just a quick run down on what is going on here: in order for chester to know your model, you MUST have an attribute called name. This attribute (name) will register the model to the application object. Chester will then be able to find your model whenever you request it.
class PeopleController extends Chester.Controller
# Register Controller to application
Chester._('app').add(new PeopleController('PeopleController'))
Just like with the model, the controller needs to have an attribute called name. That is the actual name used for Chester to recognize the controller.
class PeopleIndex extends Chester.View
render: (params) ->
# TODO: add your presentation code here.
# Register view to Patients Controller
Chester._('app')._("PeopleController").add(new PeopleIndex("index"))
// Include MVC Framework
Ti.include('chester.js');
// Register Controllers
Ti.include('controllers/people_controller.js');
// Register Models
Ti.include('models/person.js');
// Register Views
Ti.include('views/peoples/index.js');
The object hierarchy is very straight forward. Chester has a base object which has an add method and a find method.
This is the core class definition that all other classes inherit.
This objects children are controllers. With the add method you can add new controllers to this object. With the find method you can locate the controller by the name of the controller.
####Add and Find Example:
There is another array of objects attached to this class called models. These are basic classes that can added to the Models array.
This object's children are views. These are not the same as views in Titanium. These are simple JavaScript classes that are used to contain the user interface code to manage your mobile application.
This will be the most confusing class because the UI objects in Titanium are user views. The Chester views are more like code containers that help isolate your user interface code from your business logic and domain logic.
This is the main routing method that makes the whole application work. It takes the following parameters as a JavaScript object.
This method simply finds the controller and executes the action method on the controller, passing the params object as the parameter.
Chester is built using coffee because it is much easier to maintain. But, you don't need to use coffeescript to use Chester! You can use JavaScript just fine.
FAQs
Unknown package
We found that chester demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.