New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Component like composite-pattern #503

Closed
Ragazzo opened this Issue Jun 6, 2013 · 92 comments

Comments

Projects
None yet
@Ragazzo
Contributor

Ragazzo commented Jun 6, 2013

It would be great if we have ability to set components on some basic class extended from Component, so in this way it will be smth. like composite pattern, also @samdark do you remeber this suggestions from russian php forum? Any other thoughts of core-developers? In Yii1 i was missing this functionality, that i can't do smth. like this for example:

class MyComponent extends CComponent
{
}

$a = new MyComponent();
$a->setComponent($b);
$a->setComponents($config); //configure

I think this functionality can be cleared from Module and set to the Component class.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jun 6, 2013

Member

This one is about providing a facility to lazy-inject classes into your own custom component and configure its properties.

Member

samdark commented Jun 6, 2013

This one is about providing a facility to lazy-inject classes into your own custom component and configure its properties.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

What lazy-inject is? O_o I'm only talking about solution where we have ability to set components on other components.

Contributor

Ragazzo commented Jun 6, 2013

What lazy-inject is? O_o I'm only talking about solution where we have ability to set components on other components.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jun 6, 2013

Member

Umm... Why can't you do it currently?

Member

samdark commented Jun 6, 2013

Umm... Why can't you do it currently?

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

Component class has no methods for this, all this now is in Module class. For example, when i create some component that has not so much business-logic to be called Module, but it must have other components, so in current implementation i need to copy this functionality from Module class every time.

Contributor

Ragazzo commented Jun 6, 2013

Component class has no methods for this, all this now is in Module class. For example, when i create some component that has not so much business-logic to be called Module, but it must have other components, so in current implementation i need to copy this functionality from Module class every time.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

I am talking about this methods in Module class:
getComponent, setComponent, hasComponent, getComponents, setComponents and maybe preloadComponents to load components when component is init.

Contributor

Ragazzo commented Jun 6, 2013

I am talking about this methods in Module class:
getComponent, setComponent, hasComponent, getComponents, setComponents and maybe preloadComponents to load components when component is init.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

Could you show some examples why you need this?

Member

qiangxue commented Jun 6, 2013

Could you show some examples why you need this?

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

unfortunately i cant show code, but i can describe situation (that i faced with), it smth. like this:
i have to write configs in different ways, so i need for example to provide some metadata, so:

class FileSchema extends Schema
{
     public $routes = array(
         'firstRoute' => 'FirstRouteClass', //can be also array like needed for component creation
         'secondRoute' => 'SecondRouteClass',
         ....
     );
}

so this situation is very common, i need to be able to set this for example from configs, or i need to set routes with some methods, and thats why all this components methods i need, without them i need to write this functionality by myself again :( Also back for example, each route can provide different metadata (same case as above) format (1 class - 1 metadata type), and again i need to write some code by myself for this, because basic CComponent has no methods for this. Some other developers on ru-forume were also voting for this change.

Contributor

Ragazzo commented Jun 6, 2013

unfortunately i cant show code, but i can describe situation (that i faced with), it smth. like this:
i have to write configs in different ways, so i need for example to provide some metadata, so:

class FileSchema extends Schema
{
     public $routes = array(
         'firstRoute' => 'FirstRouteClass', //can be also array like needed for component creation
         'secondRoute' => 'SecondRouteClass',
         ....
     );
}

so this situation is very common, i need to be able to set this for example from configs, or i need to set routes with some methods, and thats why all this components methods i need, without them i need to write this functionality by myself again :( Also back for example, each route can provide different metadata (same case as above) format (1 class - 1 metadata type), and again i need to write some code by myself for this, because basic CComponent has no methods for this. Some other developers on ru-forume were also voting for this change.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Jun 6, 2013

Member

@Ragazzo it's basically what you can do with components for Module but for your own component, right? An ability to have sub-components for your own component the same way Module does.

Member

samdark commented Jun 6, 2013

@Ragazzo it's basically what you can do with components for Module but for your own component, right? An ability to have sub-components for your own component the same way Module does.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

But, i dont want to extend from Module class, i need a module component to have some sub-components (and also have the ability to set sub-components properties from config). In current implementation i cant do this, i only need to create Module or right all by myself (( Thats why i think this can be changed, also Module class will have better design after this refactoring. I think this is a good way to go.

Contributor

Ragazzo commented Jun 6, 2013

But, i dont want to extend from Module class, i need a module component to have some sub-components (and also have the ability to set sub-components properties from config). In current implementation i cant do this, i only need to create Module or right all by myself (( Thats why i think this can be changed, also Module class will have better design after this refactoring. I think this is a good way to go.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

@Ragazzo Your example is not quite the same as the Module case because you don't need lazy loading, and it's very easy to implement what you want: just define a setRoutes() method which will take an array of configuration and create the routes based on the configuration.

Member

qiangxue commented Jun 6, 2013

@Ragazzo Your example is not quite the same as the Module case because you don't need lazy loading, and it's very easy to implement what you want: just define a setRoutes() method which will take an array of configuration and create the routes based on the configuration.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

Yes, but this is just a same if it can be out-of-the-box in Component class. And in this way, i need to write every time some set* methods, but if it was a basic functionality of Component class i would not need to do that.

Contributor

Ragazzo commented Jun 6, 2013

Yes, but this is just a same if it can be out-of-the-box in Component class. And in this way, i need to write every time some set* methods, but if it was a basic functionality of Component class i would not need to do that.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

How could this be done in Component to help you?

Member

qiangxue commented Jun 6, 2013

How could this be done in Component to help you?

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

Just make a private $_components = array(); and other methods for setting and retrieving components (that i've described above, they exists in Module class) in Component class, it will not hurt the BC because Module class also extending from Component. This will help me to set sub-components properties from config, also this will help me to set other components in already existing components (some DI for example).

Contributor

Ragazzo commented Jun 6, 2013

Just make a private $_components = array(); and other methods for setting and retrieving components (that i've described above, they exists in Module class) in Component class, it will not hurt the BC because Module class also extending from Component. This will help me to set sub-components properties from config, also this will help me to set other components in already existing components (some DI for example).

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

I think i can provide a PR later, if you want to see how this will affect existing code.

Contributor

Ragazzo commented Jun 6, 2013

I think i can provide a PR later, if you want to see how this will affect existing code.

@klimov-paul

This comment has been minimized.

Show comment
Hide comment
@klimov-paul

klimov-paul Jun 6, 2013

Member

It would be better to introduce "ComponentFactory" class, which provides the components storage feature. "Component" class will be left as it is. "ComponentFactory" will extend "Component", "Module" will extend "ComponentFactory".

Member

klimov-paul commented Jun 6, 2013

It would be better to introduce "ComponentFactory" class, which provides the components storage feature. "Component" class will be left as it is. "ComponentFactory" will extend "Component", "Module" will extend "ComponentFactory".

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

No need PR. I understand what you want to achieve, but that's something I want to avoid introducing into a base class like Component unless you have convincing use cases. Your example is different from Module and doesn't need this functionality.

Member

qiangxue commented Jun 6, 2013

No need PR. I understand what you want to achieve, but that's something I want to avoid introducing into a base class like Component unless you have convincing use cases. Your example is different from Module and doesn't need this functionality.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

Ok, as you say (

Contributor

Ragazzo commented Jun 6, 2013

Ok, as you say (

@Ragazzo Ragazzo closed this Jun 6, 2013

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

Note what Module provides:

  1. configure components
  2. delayed loading of components
  3. magic access via component IDs

Your example doesn't need 2 and 3, and I think most composite components don't need them either.

Member

qiangxue commented Jun 6, 2013

Note what Module provides:

  1. configure components
  2. delayed loading of components
  3. magic access via component IDs

Your example doesn't need 2 and 3, and I think most composite components don't need them either.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

But i need it, i need to set sub-components from the config. And i need to reconfigure sub-components, but i cant do this in current way. And i cant every time create a module for a main module, just to have an ability to set or configure sub-components.

Contributor

Ragazzo commented Jun 6, 2013

But i need it, i need to set sub-components from the config. And i need to reconfigure sub-components, but i cant do this in current way. And i cant every time create a module for a main module, just to have an ability to set or configure sub-components.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

I know you need it. :) Please show a convincing use case for it (your previous one is not a valid one). This will let us understand better the needs and design accordingly. We need to take extra care to change a base class like Component or Object needs extra care because the change will affect the whole class hierarchy.

Member

qiangxue commented Jun 6, 2013

I know you need it. :) Please show a convincing use case for it (your previous one is not a valid one). This will let us understand better the needs and design accordingly. We need to take extra care to change a base class like Component or Object needs extra care because the change will affect the whole class hierarchy.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

@klimov-paul Yes, adding a separate layer above Component is a possible solution, although the name ComponentFactory doesn't sound right. And I still want to see the necessity of having this layer because I think most components don't need the above feature 2 and 3 (especially 3).

Member

qiangxue commented Jun 6, 2013

@klimov-paul Yes, adding a separate layer above Component is a possible solution, although the name ComponentFactory doesn't sound right. And I still want to see the necessity of having this layer because I think most components don't need the above feature 2 and 3 (especially 3).

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

Ok, i will provide my config and components structure today evening or tomorrow. As for factory, i dont think it needed, we already have a factory method that suites fine everybody i think.

Contributor

Ragazzo commented Jun 6, 2013

Ok, i will provide my config and components structure today evening or tomorrow. As for factory, i dont think it needed, we already have a factory method that suites fine everybody i think.

@klimov-paul

This comment has been minimized.

Show comment
Hide comment
@klimov-paul

klimov-paul Jun 6, 2013

Member

Here is closest example I can find:

At the moment I am working on the external service authentication component for Yii 1.1.x. It should provide the ability for the user to authenticate using Google, Facebook, Twitter and so on. I have created and application component (extension of CApplicationComponent) named “ExternalAuth”. For each external auth service (Google, Facebook, Twitter and so on) I have created a separated classes extending CComponent. Each of this a component may have unique set attributes and definitely will have unique configuration. To be able to configure entire “ExternalAuth” component I need to provide it ability to consume configuration in following format:

// Application configuration file
…
‘components’ => array(
    ‘extAuth’ => array(
        ‘class’ => ‘ExternalAuth’,
        ‘services’ => array(
            ‘google’ => array(
                ‘class’ => ‘GoogleOpenId’,
            ),
            ‘facebook’ => array(
                ‘class’ => ‘FacebookOAuth’,
                ‘client_id’ => ‘facebook_client_id’,
                ‘client_secret’ => ‘facebook_client_secret’,
            ),
        ),
    ),
),

In order to achieve this I have to repeat logic from “CModule” inside “ExternalAuth”.

Member

klimov-paul commented Jun 6, 2013

Here is closest example I can find:

At the moment I am working on the external service authentication component for Yii 1.1.x. It should provide the ability for the user to authenticate using Google, Facebook, Twitter and so on. I have created and application component (extension of CApplicationComponent) named “ExternalAuth”. For each external auth service (Google, Facebook, Twitter and so on) I have created a separated classes extending CComponent. Each of this a component may have unique set attributes and definitely will have unique configuration. To be able to configure entire “ExternalAuth” component I need to provide it ability to consume configuration in following format:

// Application configuration file
…
‘components’ => array(
    ‘extAuth’ => array(
        ‘class’ => ‘ExternalAuth’,
        ‘services’ => array(
            ‘google’ => array(
                ‘class’ => ‘GoogleOpenId’,
            ),
            ‘facebook’ => array(
                ‘class’ => ‘FacebookOAuth’,
                ‘client_id’ => ‘facebook_client_id’,
                ‘client_secret’ => ‘facebook_client_secret’,
            ),
        ),
    ),
),

In order to achieve this I have to repeat logic from “CModule” inside “ExternalAuth”.

@klimov-paul

This comment has been minimized.

Show comment
Hide comment
@klimov-paul

klimov-paul Jun 6, 2013

Member

name ComponentFactory doesn't sound right.

Possible names:

  • ComponentHub
  • ComponentStorage
  • ComponentComposite
  • ComponentCollection
Member

klimov-paul commented Jun 6, 2013

name ComponentFactory doesn't sound right.

Possible names:

  • ComponentHub
  • ComponentStorage
  • ComponentComposite
  • ComponentCollection
@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Jun 6, 2013

Contributor

well, so @klimov-paul provided even better example, so i will not provide mine, it is also looks like his example. But do we really need separated class for only creating components? The base thing in factory is that it must be overwrited by other classes, so i think factory method will be just enough, like it is made right now, no?
I think moving some functionality from Module to Component will be ok in this way, what do u think?

Contributor

Ragazzo commented Jun 6, 2013

well, so @klimov-paul provided even better example, so i will not provide mine, it is also looks like his example. But do we really need separated class for only creating components? The base thing in factory is that it must be overwrited by other classes, so i think factory method will be just enough, like it is made right now, no?
I think moving some functionality from Module to Component will be ok in this way, what do u think?

@nkostadinov

This comment has been minimized.

Show comment
Hide comment
@nkostadinov

nkostadinov Jun 6, 2013

The request here sounds like DI Component. May be a base container class on top of Component will be best and will provide the DI functionality in the fw.

nkostadinov commented Jun 6, 2013

The request here sounds like DI Component. May be a base container class on top of Component will be best and will provide the DI functionality in the fw.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Jun 6, 2013

Member

Yes, I think we should think more about this. In particular, we should consider if we want to provide DI and how it will play with the rest of the framework and the application code.

Member

qiangxue commented Jun 6, 2013

Yes, I think we should think more about this. In particular, we should consider if we want to provide DI and how it will play with the rest of the framework and the application code.

@cebe cebe reopened this Jun 7, 2013

@ghost ghost assigned qiangxue Jun 29, 2013

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 15, 2014

Member

Nope, an object is not created until get() is called.

What exactly is your question? It seems we are looping around. You may view Yii::createObject() as the new operator except that the former will respect Yii::$objectConfig.

Member

qiangxue commented Mar 15, 2014

Nope, an object is not created until get() is called.

What exactly is your question? It seems we are looping around. You may view Yii::createObject() as the new operator except that the former will respect Yii::$objectConfig.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 15, 2014

Contributor

my question is:
how object will be created if i register it like this:


class MyCustomObject
{
}

`components` => [
      'customObject' => 'MyCustomObject',
],

it also can be different classes from other fw and etc. If they will be created with Yii::createObject that means that some array will be passed to __construct() but objects may not expect such behavior, that is what i am talking about. Maybe we will need services init. based on env, such idea was spoken long time ago too - main thing is that service should know how it should be init. and created, this is implemented with service init. layer (read it as class), that will create object and init it as needed.

Contributor

Ragazzo commented Mar 15, 2014

my question is:
how object will be created if i register it like this:


class MyCustomObject
{
}

`components` => [
      'customObject' => 'MyCustomObject',
],

it also can be different classes from other fw and etc. If they will be created with Yii::createObject that means that some array will be passed to __construct() but objects may not expect such behavior, that is what i am talking about. Maybe we will need services init. based on env, such idea was spoken long time ago too - main thing is that service should know how it should be init. and created, this is implemented with service init. layer (read it as class), that will create object and init it as needed.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 15, 2014

Member

Yes, if you give a config array for an object, it will be passed to the constructor. We may do it better by checking if Object is the base class. If not, the config array will be applied after the object is created.

Maybe we will need services init.

More details?

Member

qiangxue commented Mar 15, 2014

Yes, if you give a config array for an object, it will be passed to the constructor. We may do it better by checking if Object is the base class. If not, the config array will be applied after the object is created.

Maybe we will need services init.

More details?

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 15, 2014

Contributor

yes, i have some thoughts but i think that this can be something overcomplicated and i discarted it. So if i will need custom object creating i always can use callback function for this purpose and put all such things in separated file like /config/ioc.php and in it:

Yii::$app->setComponent('custom', function ($container) {
      $custom = MyCustomObject();
      $custom->setSomething('some-value');
      ....
      return $custom;
});

so if this is a valid use-case then we should provide docs for this as an example i think ?

Also we may consider to implement something like L4 service providers - thing to group similar providers in class, because some init. may be needed for them, based on env. You can look like in L4 it is done, however it is simple class-wrapper as you can see, nothing special.

Such situation can be used when we for example may use different classes and components from other frameworks, and if we use several of such components, we may need some good way to pre-init them on some env. conditions, with that said it is better to organize them into some structure - service provider.

Contributor

Ragazzo commented Mar 15, 2014

yes, i have some thoughts but i think that this can be something overcomplicated and i discarted it. So if i will need custom object creating i always can use callback function for this purpose and put all such things in separated file like /config/ioc.php and in it:

Yii::$app->setComponent('custom', function ($container) {
      $custom = MyCustomObject();
      $custom->setSomething('some-value');
      ....
      return $custom;
});

so if this is a valid use-case then we should provide docs for this as an example i think ?

Also we may consider to implement something like L4 service providers - thing to group similar providers in class, because some init. may be needed for them, based on env. You can look like in L4 it is done, however it is simple class-wrapper as you can see, nothing special.

Such situation can be used when we for example may use different classes and components from other frameworks, and if we use several of such components, we may need some good way to pre-init them on some env. conditions, with that said it is better to organize them into some structure - service provider.

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 15, 2014

Member

components is a massive way of configuring the container. You can use set() to configure individual class. So nothing is special here. Your example of using anonymous function is already supported.

L4 service provider is just a way to run a piece of code from a class during bootstrap time. We already have Application::extensions which does similar thing.

Member

qiangxue commented Mar 15, 2014

components is a massive way of configuring the container. You can use set() to configure individual class. So nothing is special here. Your example of using anonymous function is already supported.

L4 service provider is just a way to run a piece of code from a class during bootstrap time. We already have Application::extensions which does similar thing.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 16, 2014

Contributor

nope, extenstions are not the same as providers for services in L4. Overall it can be something like this:


class CustomProvider extends ServiceProvider
{

    public function init()
    {
         $this->registerServices();
    }

    public function registerFirstService()
    {
        ....
    }

    public function registerSecondService()
    {
        ....
    }

}

by this we can plug in and configure services as needed, without puttin them in plain file as i described above, this makes services configuring flexible.

Also as for anonymous functions, i know they are supported, i just asked if my example with plain file is correct. If so then maybe we should add later to docs this example.

Contributor

Ragazzo commented Mar 16, 2014

nope, extenstions are not the same as providers for services in L4. Overall it can be something like this:


class CustomProvider extends ServiceProvider
{

    public function init()
    {
         $this->registerServices();
    }

    public function registerFirstService()
    {
        ....
    }

    public function registerSecondService()
    {
        ....
    }

}

by this we can plug in and configure services as needed, without puttin them in plain file as i described above, this makes services configuring flexible.

Also as for anonymous functions, i know they are supported, i just asked if my example with plain file is correct. If so then maybe we should add later to docs this example.

@qiangxue qiangxue referenced this issue Mar 18, 2014

Merged

DI container #2788

2 of 3 tasks complete
@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 21, 2014

Member

All features are done.
Reopened for documentation purpose.

Member

qiangxue commented Mar 21, 2014

All features are done.
Reopened for documentation purpose.

@qiangxue qiangxue reopened this Mar 21, 2014

@qiangxue qiangxue modified the milestones: 2.0 RC, 2.0 Beta Mar 21, 2014

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 21, 2014

Contributor

ArrayAccess done ?

Contributor

Ragazzo commented Mar 21, 2014

ArrayAccess done ?

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 21, 2014

Member

Nope as it doesn't make sense

On Friday, March 21, 2014, Mark notifications@github.com wrote:

ArrayAccess done ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38249635
.

Member

qiangxue commented Mar 21, 2014

Nope as it doesn't make sense

On Friday, March 21, 2014, Mark notifications@github.com wrote:

ArrayAccess done ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38249635
.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 21, 2014

Contributor

hm, afaik in sf2 you can act with container as array? no?

Contributor

Ragazzo commented Mar 21, 2014

hm, afaik in sf2 you can act with container as array? no?

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 21, 2014

Member

Yes but it still doesn't make sense

On Friday, March 21, 2014, Mark notifications@github.com wrote:

hm, afaik in sf2 you can act with container as array? no?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38268606
.

Member

qiangxue commented Mar 21, 2014

Yes but it still doesn't make sense

On Friday, March 21, 2014, Mark notifications@github.com wrote:

hm, afaik in sf2 you can act with container as array? no?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38268606
.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 21, 2014

Contributor

why it does not make sense?

Contributor

Ragazzo commented Mar 21, 2014

why it does not make sense?

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 21, 2014

Member

Why array access?

On Friday, March 21, 2014, Mark notifications@github.com wrote:

why it does not make sense?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38269007
.

Member

qiangxue commented Mar 21, 2014

Why array access?

On Friday, March 21, 2014, Mark notifications@github.com wrote:

why it does not make sense?


Reply to this email directly or view it on GitHubhttps://github.com//issues/503#issuecomment-38269007
.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 21, 2014

Contributor

Useful for setting components, same issues as for sf2 overall .

Contributor

Ragazzo commented Mar 21, 2014

Useful for setting components, same issues as for sf2 overall .

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Mar 21, 2014

Member

Arrayaccess should not be abused. It should be mainly used by classes that represent data collections. Otherwise we would say any classes should implement this as it is convenient to set properties. I don't think sf2 is making a good choice here (other fws are not doing this.) Anyway, let's not spend more time trying to convince each other. We can always implement this in future if there are strong requests for this feature.

Member

qiangxue commented Mar 21, 2014

Arrayaccess should not be abused. It should be mainly used by classes that represent data collections. Otherwise we would say any classes should implement this as it is convenient to set properties. I don't think sf2 is making a good choice here (other fws are not doing this.) Anyway, let's not spend more time trying to convince each other. We can always implement this in future if there are strong requests for this feature.

@Ragazzo

This comment has been minimized.

Show comment
Hide comment
@Ragazzo

Ragazzo Mar 21, 2014

Contributor

Ok )

Contributor

Ragazzo commented Mar 21, 2014

Ok )

@qiangxue qiangxue modified the milestones: 2.0 GA, 2.0 RC Apr 16, 2014

@qiangxue qiangxue closed this in ad7f57d Apr 20, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment