镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add Default extensions #301

Open
Open

Description

@ENikS

Default Extensions

Unity v4 implemented two extensions:

  • UnityDefaultStrategiesExtension
  • UnityDefaultBehaviorExtension

These extensions were responsible for adding default policies, strategies, and factories to the container. The main benefit of these two was in standardized way an initialization took place. All the initialization code was in the same, well known location and was easy to learn and customize.

The problem was it created significant performance overhead.

The Problem

Extension implementation in both Unity v4 and v5 required the extension to be instantiated class. With memory allocated and time wasted as overhead. So, in Unity v5 these two extensions were removed to optimize performance and memory management. The initialization was implemented in part in constructor or as private methods.

Unity v6

Unity v6 solved extension overhead issue by allowing an action to be used instead of a class instance. This allows to bring back these two extensions without increasing overhead. It is a good idea to have initialization code all in the well known and documented location.

Activity

  1. added this to the 6.0.0 milestone on Dec 24, 2020
  2. self-assigned this
    on Dec 24, 2020
  3. added a commit that references this issue on Jan 3, 2021
    777610b
  4. added a commit that references this issue on Jan 3, 2021
    59fe0aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Enhancement 🔨Improvement of existing features

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions