Recently released on pub:

  • angular2: v2.0.0-beta.5 - Alex Eagle , Chirayu Krishnappa , Jeff Cross , Matias Niemela , Misko Hevery , Rado Kirov , Tobias Bosch , Victor Savkin , Yegor Jbanov , Jeremy Elbourn
  • benchpress: v2.0.0-beta.5 - Alex Eagle , Chirayu Krishnappa , Jeff Cross , Matias Niemela , Misko Hevery , Rado Kirov , Tobias Bosch , Victor Savkin , Yegor Jbanov , Jeremy Elbourn
  • angular2_benchmarks: v2.0.0-beta.5 - Alex Eagle , Chirayu Krishnappa , Jeff Cross , Matias Niemela , Misko Hevery , Rado Kirov , Tobias Bosch , Victor Savkin , Yegor Jbanov , Jeremy Elbourn
Show more releases

Latest Blog Posts

Unboxing Packages: source_span

Natalie Weizenbaum, on 09 Feb 2016
One of the best aspects of a package ecosystem is its ability to foster language-wide conventions without direct involvement from the SDK. Packages work together and build on one another to create something more than any of them could be on their own. The glue that holds this structure together is made of little packages that establish these conventions, that provide a shared language for the ecosystem as a whole to use. One of these glue packages that I find most useful is source_span. This package began its life as part of the more specialized source_maps package, it quickly became... read more

A Nearly Modern Factory Method Pattern

Chris Strom, on 09 Feb 2016
I could make do with the examples of the factory method pattern that I have been using. Still, I would prefer an example that touches the modern web a little closer. Or at least the web. So tonight I try my hand at a venerable, if simple, form builder.I am not going to worry too much about the details of adding different types of HTML form inputs at this point. To kick things off, I start by adding variations of text input fields to a container. So my Dart abstract creator class declares that it needs to be constructed with... read more

Silly Factories in the Factory Method Pattern

Chris Strom, on 08 Feb 2016
Tonight, I look into using Dart factory constructors in the factory method pattern. Since they both have the word "factory" in them they can probably be used together, right? Well, probably not, but I can no longer resist pairing the two.Normal generative constructors in Dart behave like constructors in just about any object-oriented language. They create a new instance of the current class, optionally setting some instance variables. Factory constructors, on the other hand, are responsible for building and initializing the object being created. This means that factory constructors can return anything—not limited to the current class.Take, for instance, a... read more

Factory Games with Mirrors

Chris Strom, on 07 Feb 2016
Up tonight I finally carry through on my threat to apply mirrors to the factory method pattern in Dart. I am unsure if my beloved mirrors can have their usual improving effect (in my eyes at least), but I am always happy to have an excuse to play with reflection and mirrors. Tonight's excuse comes in the form of the language specific implementations mentioned in the Gang of Four book. They mentioned that factory methods in Smalltalk often return the class to be created instead of an object. Aside from having to import the dart:mirrors library, it is not much... read more

I've Got a Factory in My Factory in My Class Hierarchy of Factories (or Something Like That)

Chris Strom, on 06 Feb 2016
Yesterday I worked up a Dart example of the factory method pattern in which a "game factory" could pit two players against each other in a series of board games:main() { var series = new GameFactory('Professor Falken', 'Joshua'); series ..start() ..createBoardGame('Checkers').play() ..createBoardGame('Thermo Nuclear War').play() ..createBoardGame().play();}Most of the concrete implementation of the pattern is placeholder print() statements. The code so far establishes a series of games between two players, creates a board game via the factory method from which the pattern gets its name, then plays the game. Currently, this results in output along the lines of:$ ./bin/board_game.dart*** Professor Falken vs.... read more