Dependency Injection is a very practical technique for writing testable code and swappable implementation.

https://dev.to/hongster85/dependency-injection-understand-in-3-minutes-3a5k

#bestpractices #coding #codingprinciples #designpattern #programming #dependencyinjection

Dependency Injection : Understand in 3 Minutes

Problem Statement Dependency Injection (DI) is a technique where an object receives its...

DEV Community

After several hours of concentrated work, a lot of repetitive copy/paste and search/replace as well as a bit of semi-successful utilization of AI agents, I migrated our Android application from dependency injection via Hilt to Metro (by @ZacSweers). 580 files were touched in this process 😅

I already appreciate the concise syntax and Anvil-esque aggregation ❤️

#Android #AndroidDev #Hilt #Dagger #Metro #Anvil #DependencyInjection

⚡ Veld Framework v1.0.3: Compile-Time Dependency Injection

Key innovation: ASM bytecode weaving only for @inject on private fields.
Zero runtime reflection. Everything else is pure method calls.

Performance: 5.9M ops/ms | startup: 1μs | memory: 2.1MB

🏗️ All contributors are welcome!

GitHub: https://github.com/yasmramos/Veld

#Java #OpenSource #Microservices #DI #DependencyInjection #CompileTime #Veld

GitHub - yasmramos/Veld: Ultra-fast Dependency Injection for Java - Zero Reflection, Pure Code Generation

Ultra-fast Dependency Injection for Java - Zero Reflection, Pure Code Generation - yasmramos/Veld

GitHub

Level Up Your SharePoint Skills: SPFx Best Practices for Coders

784 words, 4 minutes read time.

The world of SharePoint development is constantly evolving, and mastering the skills required to build robust and scalable applications is crucial for any serious coder. With the rise of SPFx, it’s essential to stay up-to-date with best practices and patterns that can help take your skills to the next level.

Introduction

The SharePoint Framework (SPFx) has revolutionized the way developers build custom applications for Microsoft 365. With its powerful combination of web development, DevOps, and business intelligence capabilities, SPFx offers a unique opportunity for coders to create innovative solutions that can transform businesses. In this article, we’ll explore some essential best practices for SPFx developers, providing practical guidance on how to level up your skills and build high-quality applications.

Understanding the Power of Modularize

import { declareCustomElement } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';@declareCustomElement({name: 'MyWebPart',metadata: {description: {type: String,default: 'This is a custom web part'}}})export class MyWebPart extends BaseClientSideWebPart {render() {return Hello World!;}onInit() {this.properties.description = 'This is an updated description'; }}

Modularize is a powerful pattern in SPFx development that allows you to break down complex applications into smaller, reusable components. By doing so, you can improve maintainability, scalability, and overall quality of your codebase. In this article, we’ll explore the benefits of modularize and provide guidance on how to implement it effectively.

Using Dependency Injection for Loose Coupling

import { injectable } from 'tsyringe';@injectable()export class MyService {private logger: Logger;constructor(logger: Logger) {this.logger = logger;}public doSomething() {this.logger.log('Doing something');}}

Dependency injection is a design pattern that allows you to decouple components from each other, making it easier to test, maintain, and extend your codebase. In SPFx development, dependency injection is particularly useful when working with services and libraries that need to be injected into your web part or component. In this section, we’ll explore the benefits of using dependency injection in SPFx and provide guidance on how to implement it effectively.

Optimizing Performance with Caching

import { CacheManager } from 'sp-core-library';const cache = new CacheManager();cache.add('myKey', 'myValue');console.log(cache.get('myKey')); // Output: 'myValue'

Optimizing performance is crucial in any web application, and SPFx is no exception. One effective way to improve performance is by using caching mechanisms. In this section, we’ll explore the benefits of caching in SPFx and provide guidance on how to implement it
effectively.

Best Practices for Unit Testing

import { TestBed } from '@angular/core/testing';import { MyService } from './my.service';describe('MyService', () => {beforeEach(() => {TestBed.configureTestingModule({providers: [MyService]});});it('should do something', () => {const service = TestBed.get(MyService);expect(service.doSomething()).toBe(true);});});

Unit testing is an essential part of any software development workflow. In SPFx, unit testing allows you to ensure that your components and services are working as expected, reducing the risk of bugs and errors in your application. In this section, we’ll explore best practices for unit testing in SPFx and provide guidance on how to write effective tests.

Conclusion / Next Steps

In this article, we’ve explored essential best practices for SPFx developers, including modularize, dependency injection, caching, unit testing, and more. By following these guidelines, you’ll be able to build high-quality applications that are scalable, maintainable, and efficient.

Next steps include implementing the patterns and techniques discussed in this article. Start by identifying areas where you can apply modularize, then experiment with dependency injection and caching mechanisms. Finally, take some time to learn about unit testing best practices and apply them to your existing codebase. With dedication and persistence, you’ll become a master SPFx developer in no time.

Call to Action

If this post sparked your creativity, don’t just scroll past. Join the community of makers and tinkerers—people turning ideas into reality with 3D printing. Subscribe for more 3D printing guides and projects, drop a
comment
sharing what you’re printing, or reach out and tell me about your latest project. Let’s build together.

Sources

Disclaimer:

The views and opinions expressed in this post are solely those of the author. The information provided is based on personal research, experience, and understanding of the subject matter at the time of writing. Readers should consult relevant experts or authorities for specific guidance related to their unique situations.

Related Posts

#agileMethodology #bestPractices #businessIntelligence #caching #ClientSide #codingPatterns #collaborationPlatform #customApplication #dependencyInjection #devops #enterpriseSoftware #microsoft365 #modularize #performanceOptimization #serverSide #SharePoint #SharePointDevelopment #SharePointFramework #softwareDevelopment #SPFx #testDrivenDevelopment #unitTesting #WebDevelopment #webPart #workflow

Let's assume we now have two approaches to #DependencyInjection in our #Swift community:

1. An #Entity where the extension on the container type defines registration. 🔄

2. A #Container that is responsible for the type registration process. 📦

#DevDiary #BuildInPublic #Swift

Implementing Cross-Platform In-App Billing in .NET MAUI Applications - .NET Blog

Learn how to implement in-app purchases in your .NET MAUI apps with our new cross-platform billing sample for Android, iOS, Mac Catalyst, and Windows.

.NET Blog

Ra mắt ioc-arise: DI container không dùng decorator, tự động đăng ký thành phần bằng cách phân tích AST. Khắc phục việc phải import @inject và viết boilerplate. Hỗ trợ đối tượng, factory, lớp (interface/abstract), quản lý vòng đời (singleton/transient) qua comment. Giúp code sạch, hiệu quả hơn.
#ioc_arise #DI #DependencyInjection #AST #Programming #Development #LậpTrình #PhátTriển

https://www.reddit.com/r/SideProject/comments/1pdthva/introducing_iocarise_a_zerodecorator_di_container/

Neue dependency-injection 7.4 kann Systeme brechen

Seit gestern mit Herauskommen der neuen dependency-injection 7.4.0 kommt es auf Systemen mit versionsübergreifenden Extensions zu Problemen. Hier meine Lösun...

Community Hub für TYPO3

🚀 Koin 4.2.0-alpha3 is out!

✅ Navigation 2.x scope support
🧹 Cleaner, better examples
🐛 Fix for Nav3 metadata args

🔗 https://github.com/InsertKoinIO/koin/releases/tag/4.2.0-alpha3

#Kotlin #AndroidDev #Compose #Koin #DependencyInjection #Android
#MobileDev

Release 4.2.0-alpha3 · InsertKoinIO/koin

What's Changed [Feat] navigation 2.x scope by @arnaudgiuliani in #2309 [Maintenance] Cleanup of examples by @GrzegorzBobryk in #2213 Fix nav3 metadata arguments by @arnaudgiuliani in #2313 Full C...

GitHub

Just published a new post on Dependency Injection in Swift.
I compare three approaches: initializer-based, property, and method injection, and show how they affect testability, modularity, and code clarity.

Do you use DI in your Swift/iOS projects?

📖 https://michalcichon.github.io/software-development/2025/11/25/dependency-injection-patterns-in-swift.html

#Swift #iOS #DependencyInjection #CleanCode

Dependency injection patterns in Swift | Michał Cichoń · iOS Software Engineer

When I first learned about it over a decade ago, I started using it everywhere possible. It’s a simple idea with a surprisingly big impact.

Michał Cichoń · iOS Software Engineer