ANN: Cube and Injector

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ANN: Cube and Injector

Lee Sylvester

Hey guys,

 

I’m happy to announce that I’ve finally pushed Cube and Injector to haXeLib.  If you install Cube (xirsys_cube), then Injector will automatically install.

 

I’ve not enough time to write a full tutorial now, so I’ll quickly outline the changes from RobotLegs and then write a proper tutorial in the morning.

 

So, first things first; when extending the context, the class you need to extend has been renamed to Agent.  This is a preference thing… The class you create is the context, but the context is based on the agent which marshals the actors…

 

Extending Agent requires two type parameters to be passed.  The first one is the display class for the current target.  For Flash, this would probably be MovieClip.  The second type is the base event class.  I use IEvent, which describes a typical flash.events.Event.

 

class FlashContext extends Agent<MovieClip, IEvent>

 

At the moment, the events system used by Cube is hxevents.  At some point, I’m going to completely abstract this so that any events framework can be integrated.  However, hxevents fits the bill for the time being, and it is cross platform…

 

The Injector framework is simplified over SwiftSuspenders.  It doesn’t yet have method parameter injection (which I could never see a use for).  Also, a couple of the methods in SwiftSuspenders have been combined, to keep its use simple.  The actual code base for Injector is fully custom, but it follows a similar path to SwiftSuspenders in order to remain familiar.  Check out the Injector class to see what the method signatures are.

 

There is also a Finite State Machine included, which requires some in depth discussion… I built from scratch, and it suits me well, but as it’s fully custom, it’s hard to compare it to anything.   Again, I’ll write a tute in the morning.

 

If anyone uses Cube, please let me know how you get on with it.  The intention of Cube is to be familiar, flexible and useful, but I’m not going to keep it rigid.  I already have some decent plans for it once I’ve worked out some kinks, so it will become more powerful.  It’s certainly useful in JavaScript apps… Makes JS development sooooooo much easier.

 

Anyway, have fun :-)

 

Lee

 

 


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Cube and Injector

jlm@justinfront.net
Lee

Do you need to remove the "Proxy.hx~" class?  interested to see a javascript example of how it all works so look forward to examples.

Cheers

;j



On 19 Sep 2011, at 22:56, Lee Sylvester wrote:

Hey guys,
 
I’m happy to announce that I’ve finally pushed Cube and Injector to haXeLib.  If you install Cube (xirsys_cube), then Injector will automatically install.
 
I’ve not enough time to write a full tutorial now, so I’ll quickly outline the changes from RobotLegs and then write a proper tutorial in the morning.
 
So, first things first; when extending the context, the class you need to extend has been renamed to Agent.  This is a preference thing… The class you create is the context, but the context is based on the agent which marshals the actors…
 
Extending Agent requires two type parameters to be passed.  The first one is the display class for the current target.  For Flash, this would probably be MovieClip.  The second type is the base event class.  I use IEvent, which describes a typical flash.events.Event.
 
class FlashContext extends Agent<MovieClip, IEvent>
 
At the moment, the events system used by Cube is hxevents.  At some point, I’m going to completely abstract this so that any events framework can be integrated.  However, hxevents fits the bill for the time being, and it is cross platform…
 
The Injector framework is simplified over SwiftSuspenders.  It doesn’t yet have method parameter injection (which I could never see a use for).  Also, a couple of the methods in SwiftSuspenders have been combined, to keep its use simple.  The actual code base for Injector is fully custom, but it follows a similar path to SwiftSuspenders in order to remain familiar.  Check out the Injector class to see what the method signatures are.
 
There is also a Finite State Machine included, which requires some in depth discussion… I built from scratch, and it suits me well, but as it’s fully custom, it’s hard to compare it to anything.   Again, I’ll write a tute in the morning.
 
If anyone uses Cube, please let me know how you get on with it.  The intention of Cube is to be familiar, flexible and useful, but I’m not going to keep it rigid.  I already have some decent plans for it once I’ve worked out some kinks, so it will become more powerful.  It’s certainly useful in JavaScript apps… Makes JS development sooooooo much easier.
 
Anyway, have fun :-)
 
Lee
 
 
-- 
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: ANN: Cube and Injector

Lee Sylvester

Hey Justin,

 

Oops :-)  I’ll sort that in the morning… Shouldn’t hurt for the moment.

 

I’ve got a simple example here that targets JS and Flash, but it’s a little old… We’ve been using Cube for over a year, now… James Jackson has made an awesome JS heavy web app with it (10,000 lines of haXe code), which you’d never want to write in pure JS :-)  And I have a big Flash based app I’ve built with around 15k lines of haXe, which is also made more pleasant thanks to Cube.

 

When targeting JS, I always use <Dynamic, IEvent> as my Agent type parameters.  With StdJS, though, there’s probably a stricter type you could use.

 

Lee

 

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: 19 September 2011 23:19
To: The haXe compiler list
Subject: Re: [haXe] ANN: Cube and Injector

 

Lee                                                                                                                                                                                      

 

Do you need to remove the "Proxy.hx~" class?  interested to see a javascript example of how it all works so look forward to examples.

 

Cheers

 

;j

 

 

 

On 19 Sep 2011, at 22:56, Lee Sylvester wrote:



Hey guys,

 

I’m happy to announce that I’ve finally pushed Cube and Injector to haXeLib.  If you install Cube (xirsys_cube), then Injector will automatically install.

 

I’ve not enough time to write a full tutorial now, so I’ll quickly outline the changes from RobotLegs and then write a proper tutorial in the morning.

 

So, first things first; when extending the context, the class you need to extend has been renamed to Agent.  This is a preference thing… The class you create is the context, but the context is based on the agent which marshals the actors…

 

Extending Agent requires two type parameters to be passed.  The first one is the display class for the current target.  For Flash, this would probably be MovieClip.  The second type is the base event class.  I use IEvent, which describes a typical flash.events.Event.

 

class FlashContext extends Agent<MovieClip, IEvent>

 

At the moment, the events system used by Cube is hxevents.  At some point, I’m going to completely abstract this so that any events framework can be integrated.  However, hxevents fits the bill for the time being, and it is cross platform…

 

The Injector framework is simplified over SwiftSuspenders.  It doesn’t yet have method parameter injection (which I could never see a use for).  Also, a couple of the methods in SwiftSuspenders have been combined, to keep its use simple.  The actual code base for Injector is fully custom, but it follows a similar path to SwiftSuspenders in order to remain familiar.  Check out the Injector class to see what the method signatures are.

 

There is also a Finite State Machine included, which requires some in depth discussion… I built from scratch, and it suits me well, but as it’s fully custom, it’s hard to compare it to anything.   Again, I’ll write a tute in the morning.

 

If anyone uses Cube, please let me know how you get on with it.  The intention of Cube is to be familiar, flexible and useful, but I’m not going to keep it rigid.  I already have some decent plans for it once I’ve worked out some kinks, so it will become more powerful.  It’s certainly useful in JavaScript apps… Makes JS development sooooooo much easier.

 

Anyway, have fun :-)

 

Lee

 

 

-- 
haXe - an open source web programming language
http://haxe.org

 


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Cube and Injector

jlm@justinfront.net
Lee

No worries just thought I would mention it, don't use robotlegs so it's all rocket science to me so look forward to tutorials, I like to keep life super simple between classes, I just use my DistpatchTo class for flash or javascript haxe, and try to avoid any Dynamic as it always trips me up.

But central event bus, and injection are areas I need to explore more, and maybe I will like cube?  But interested to see what it's all about.

The 'futures' that James talked about back at haXecon... is that part of this code?

Cheers

;j

On 19 Sep 2011, at 23:28, Lee Sylvester wrote:

Hey Justin,
 
Oops :-)  I’ll sort that in the morning… Shouldn’t hurt for the moment.
 
I’ve got a simple example here that targets JS and Flash, but it’s a little old… We’ve been using Cube for over a year, now… James Jackson has made an awesome JS heavy web app with it (10,000 lines of haXe code), which you’d never want to write in pure JS :-)  And I have a big Flash based app I’ve built with around 15k lines of haXe, which is also made more pleasant thanks to Cube.
 
When targeting JS, I always use <Dynamic, IEvent> as my Agent type parameters.  With StdJS, though, there’s probably a stricter type you could use.
 
Lee
 
 
From: [hidden email] [[hidden email]] On Behalf Of [hidden email]
Sent: 19 September 2011 23:19
To: The haXe compiler list
Subject: Re: [haXe] ANN: Cube and Injector
 
Lee                                                                                                                                                                                      
 
Do you need to remove the "Proxy.hx~" class?  interested to see a javascript example of how it all works so look forward to examples.
 
Cheers
 
;j
 
 
 
On 19 Sep 2011, at 22:56, Lee Sylvester wrote:


Hey guys,
 
I’m happy to announce that I’ve finally pushed Cube and Injector to haXeLib.  If you install Cube (xirsys_cube), then Injector will automatically install.
 
I’ve not enough time to write a full tutorial now, so I’ll quickly outline the changes from RobotLegs and then write a proper tutorial in the morning.
 
So, first things first; when extending the context, the class you need to extend has been renamed to Agent.  This is a preference thing… The class you create is the context, but the context is based on the agent which marshals the actors…
 
Extending Agent requires two type parameters to be passed.  The first one is the display class for the current target.  For Flash, this would probably be MovieClip.  The second type is the base event class.  I use IEvent, which describes a typical flash.events.Event.
 
class FlashContext extends Agent<MovieClip, IEvent>
 
At the moment, the events system used by Cube is hxevents.  At some point, I’m going to completely abstract this so that any events framework can be integrated.  However, hxevents fits the bill for the time being, and it is cross platform…
 
The Injector framework is simplified over SwiftSuspenders.  It doesn’t yet have method parameter injection (which I could never see a use for).  Also, a couple of the methods in SwiftSuspenders have been combined, to keep its use simple.  The actual code base for Injector is fully custom, but it follows a similar path to SwiftSuspenders in order to remain familiar.  Check out the Injector class to see what the method signatures are.
 
There is also a Finite State Machine included, which requires some in depth discussion… I built from scratch, and it suits me well, but as it’s fully custom, it’s hard to compare it to anything.   Again, I’ll write a tute in the morning.
 
If anyone uses Cube, please let me know how you get on with it.  The intention of Cube is to be familiar, flexible and useful, but I’m not going to keep it rigid.  I already have some decent plans for it once I’ve worked out some kinks, so it will become more powerful.  It’s certainly useful in JavaScript apps… Makes JS development sooooooo much easier.
 
Anyway, have fun :-)
 
Lee
 
 
-- 
haXe - an open source web programming language
http://haxe.org
 
-- 
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

RE: ANN: Cube and Injector

Lee Sylvester

Hi Justin,

 

With Cube, you’ll find development really simple… It makes for super lightweight apps but really powerful all the same.  With dependency injection, you simply get the classes and objects where you need them… No more having to fish for them from proxies or having to make sure you’ve sent them embedded in event classes… Much easier.  The central bus helps a lot, too, as it means you’ve always got a simple point of access for sending events and registering for them.

 

The futures James mentioned is part of our new XirSys API.  It’s a little late in the evening to discuss that, right now ;-)  but feel free to check out our website at www.xirsys.com

 

Cheers,

Lee

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: 20 September 2011 00:20
To: The haXe compiler list
Subject: Re: [haXe] ANN: Cube and Injector

 

Lee

 

No worries just thought I would mention it, don't use robotlegs so it's all rocket science to me so look forward to tutorials, I like to keep life super simple between classes, I just use my DistpatchTo class for flash or javascript haxe, and try to avoid any Dynamic as it always trips me up.

 

But central event bus, and injection are areas I need to explore more, and maybe I will like cube?  But interested to see what it's all about.

 

The 'futures' that James talked about back at haXecon... is that part of this code?

 

Cheers

 

;j

 

On 19 Sep 2011, at 23:28, Lee Sylvester wrote:



Hey Justin,

 

Oops :-)  I’ll sort that in the morning… Shouldn’t hurt for the moment.

 

I’ve got a simple example here that targets JS and Flash, but it’s a little old… We’ve been using Cube for over a year, now… James Jackson has made an awesome JS heavy web app with it (10,000 lines of haXe code), which you’d never want to write in pure JS :-)  And I have a big Flash based app I’ve built with around 15k lines of haXe, which is also made more pleasant thanks to Cube.

 

When targeting JS, I always use <Dynamic, IEvent> as my Agent type parameters.  With StdJS, though, there’s probably a stricter type you could use.

 

Lee

 

 

 

From: [hidden email] [[hidden email]] On Behalf Of [hidden email]
Sent: 19 September 2011 23:19
To: The haXe compiler list
Subject: Re: [haXe] ANN: Cube and Injector

 

Lee                                                                                                                                                                                      

 

Do you need to remove the "Proxy.hx~" class?  interested to see a javascript example of how it all works so look forward to examples.

 

Cheers

 

;j

 

 

 

On 19 Sep 2011, at 22:56, Lee Sylvester wrote:




Hey guys,

 

I’m happy to announce that I’ve finally pushed Cube and Injector to haXeLib.  If you install Cube (xirsys_cube), then Injector will automatically install.

 

I’ve not enough time to write a full tutorial now, so I’ll quickly outline the changes from RobotLegs and then write a proper tutorial in the morning.

 

So, first things first; when extending the context, the class you need to extend has been renamed to Agent.  This is a preference thing… The class you create is the context, but the context is based on the agent which marshals the actors…

 

Extending Agent requires two type parameters to be passed.  The first one is the display class for the current target.  For Flash, this would probably be MovieClip.  The second type is the base event class.  I use IEvent, which describes a typical flash.events.Event.

 

class FlashContext extends Agent<MovieClip, IEvent>

 

At the moment, the events system used by Cube is hxevents.  At some point, I’m going to completely abstract this so that any events framework can be integrated.  However, hxevents fits the bill for the time being, and it is cross platform…

 

The Injector framework is simplified over SwiftSuspenders.  It doesn’t yet have method parameter injection (which I could never see a use for).  Also, a couple of the methods in SwiftSuspenders have been combined, to keep its use simple.  The actual code base for Injector is fully custom, but it follows a similar path to SwiftSuspenders in order to remain familiar.  Check out the Injector class to see what the method signatures are.

 

There is also a Finite State Machine included, which requires some in depth discussion… I built from scratch, and it suits me well, but as it’s fully custom, it’s hard to compare it to anything.   Again, I’ll write a tute in the morning.

 

If anyone uses Cube, please let me know how you get on with it.  The intention of Cube is to be familiar, flexible and useful, but I’m not going to keep it rigid.  I already have some decent plans for it once I’ve worked out some kinks, so it will become more powerful.  It’s certainly useful in JavaScript apps… Makes JS development sooooooo much easier.

 

Anyway, have fun :-)

 

Lee

 

 

-- 
haXe - an open source web programming language
http://haxe.org

 

-- 
haXe - an open source web programming language
http://haxe.org

 


--
haXe - an open source web programming language
http://haxe.org