Page MenuHomePhabricator

Add multi factory class
Open, HighPublic

Description

The goal of a multi factory is to dispatch the creation of an item to registered factory depending on the value of a property returned by the model. This is useful in a lot of case and shouldn't be specific to any type of view.

cedric created this task.Wed, Nov 21, 5:53 PM
cedric triaged this task as High priority.

Should this be specific to one property?

What do you mean by 'one' property ? My idea is that you just have one default property that will be used to figure out the dispatching. All the other property/factory linked to the multi factory will automatically be applied on the redirected factory. If to figure out the style, you need to coalesce multiple property or have any kind of logic, that should be done in the ViewModel.