Skip to content
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

Add Default extensions #301

Open
ENikS opened this issue Dec 24, 2020 · 0 comments
Open

Add Default extensions #301

ENikS opened this issue Dec 24, 2020 · 0 comments
Assignees
Labels
Enhancement 🔨 Improvement of existing features
Milestone

Comments

@ENikS
Copy link
Contributor

ENikS commented Dec 24, 2020

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.

@ENikS ENikS added the Enhancement 🔨 Improvement of existing features label Dec 24, 2020
@ENikS ENikS added this to the 6.0.0 milestone Dec 24, 2020
@ENikS ENikS self-assigned this Dec 24, 2020
ENikS added a commit that referenced this issue Dec 24, 2020
ENikS added a commit that referenced this issue Dec 24, 2020
ENikS added a commit that referenced this issue Dec 24, 2020
ENikS added a commit that referenced this issue Jan 3, 2021
@github-actions github-actions bot added the release Release branch label Jan 3, 2021
@ENikS ENikS removed the release Release branch label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 🔨 Improvement of existing features
Projects
None yet
Development

No branches or pull requests

1 participant