Giter VIP home page Giter VIP logo

dawn's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dawn's Issues

wrapper API for Builder and CommandMap

Currently when building an application with Dawn you have to create a CommandMap and a Builder separately. It is good that there libraries have separate entry points, so dependency injection can be used without the commands code, but for application that want both a facade across the two classes would be convient.

interface IDawn {
  function getObject():Object;
  function addConfig(config:IConfig):void;
  function addCommand(command:Class):void;
}

provide default implementation metadata

Should be able to specify within a interface what the default implementation is.

Syntax option:

[ImplementedBy(qname='uk.co.ziazoo.Builder')]
interface IBuilder {
 ...
}

or if package is the same ?

[ImplementedBy(name='Builder')]
interface IBuilder {
 ...
}

tutorial on creation of a simple project

Need a get started guide, but in the mean time some docs or a blog on how to create a basic project would do the trick

Can begin by extending the PersonManager

naming of framework and modules

Need some names for the framework as a whole (could stick with Beckys inspited boogawooble) and for the major components

The two main parts are:

  • The Notification code
  • The IOC code

could just go with notifier and ioc, but thats a little dry?

Add hierarchical injectors

Injectors can have children and parents

var child:IInjector = injector.createChild();
var child:IInjector = injector.createChildInApplicationDomain(appDomain);

child.getParent() // return IInjector

Child injectors inherit the mappings or their parent. Mappings on the child stay in the child and do not filter up to the parent

design constructor based injection

Currently only accessor based injection is supported, want to add constructor injection. It is currently not in the framework as the actionscript reflection api does not provide type information for constructor arguments.

Perhaps metadata could be used to explain the types and order of the constructors arguments

Something like

[Inject]
[Named(arg=doThing,name="DoOneThingImpl")]
class MyThing {
    function constructor( doThing:IDoOneThing, doAnother:IDoAnother){}
}

Need to check if the order of metadata is preserved, such that adding order to the metadata would be unnecessary.

life cycle triggers

Could define optional methods that are called before and after a managed object has its dependencies set. These methods could be identified by metadata so no compile time dependence is created

[DependenciesInjected]
function callMeWhenIHaveMyDependencies():void{}

Create asEagerSingleton option

asEagerSingleton will create the object before it is requested directly or as a dependency. This could be useful in creating a service object that can cache some data from the server before the view that needs it is created

add providers for custom object creation

Sometimes it will make sense for the user to create objects themselves, perhaps there are required constructor arguments of the object already exists.

Providers will fill the gap, allowing the ioc library to delegate some objects creation to custom user code

Should providers be classes or function (or both)?

[Inject]
[Provider]
public function getThing( stuffINeed:Stuff ):Thing{}
class ThingProvider{
  function ThingProvider(){}
  [Provider] function getThing():Thing{}
  [Inject] function set somthingThatIsNeeded(value:Somthing):void{}
}
[Provider]
fuction getSomeViewObject():View{
  Application.application.someViewId;
}

mxml is none DI. Objects are directly created within markup, you cant program to an interface in mxml, this is why providers are so crucial

providers could also be used to set properties on objects, these properties could even come from external (property files) sources?

Update

Have commited a first pass at providers. Only class based at the moment

allow for different flavors of dependencies

Two objects may both require an instance of IDoSomthing, but they could need different implementations. Want a neat way, preferable with metadata of specifying which is desired by any given class

  • this suggests that a class should have more than one provider
  • extra providers could be named, so a class may specify it wants a particular flavor of provider, but unless that flavor is named in the config it would get the default
mapping.map( IWobble, WobbleProvider );
mapping.map( IWobble, MegaWobbleProvider, "Mega" );

The class could then specify that it would like the Mega provider

[Inject(name='Mega')]
function set wobble(value:IWobble):void;

create lightweight listeners

Not all objects will want to the same level of detail about every notification that is sent. For some objects it may be overkill to implement the handler interface, for these objects a a callback could be mapped to a notification type.

addCallback( notificationType:Class, callback:Function );

Remove as3ds dependence

The injector currently depends on as3ds, which is no longer supported in actionscript. Refactor code to use simple custom tree structure code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.