Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

[Proposal] return an array of strings from getFacadeAccessor #1490

@imanghafoori1

Description

@imanghafoori1

Currently Facades will eventually call one method on one object.
image

Maybe we return an array for strings or objects:

image

or the abstract string can may represent a "tag" on the container so that all the tagged instances get called. ( I think we should return 'tag' from an other method, and not getFacadeAccessor)

It starts to compete with events feature which already do the same job, but this can differ from that in the way, that each call is made with the result of the previous call.

the returned value of A1 is delivered as parameter to A2
and returned value from A2 to delivered to A3
The final value we get from the Facade call is the return value from A3

This is useful to add preConditions and postConditions to a method call or some how decorate it.
usage example:

  • Converting null values to Null objects (postCondition)
  • Normalizing parameters before handing them to the actual Facade (preCondition)

Note that the two cases above do not violate the L in SOLID
so if we apply them to existing Facades used in an app nothing breaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions