POO Avancée & Architecture Logicielle avec C#

🧰 Module 1

Écosystème Moderne & Tooling Professionnel

Objectif: maîtriser un environnement .NET industriel sans dépendre de Visual Studio IDE.

POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

📝 Changelog — V0.0.1

  • Création du deck d'ouverture du module C# avancé.
  • Focus: workflow CLI-first, structure src/tests, solutions multi-projets, packages et hot reload.
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Pourquoi un workflow CLI-first ?

  • La CLI .NET est stable, scriptable et reproductible sur CI.
  • VS Code reste léger, portable et transparent sur les étapes de build.
  • Le développeur comprend exactement ce qui se passe entre source, compilation et exécution.
  • La solution devient outillable sans dette IDE.
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Environnement minimal recommandé

  • SDK .NET LTS installé via paquet officiel Microsoft.
  • VS Code avec C# Dev Kit et extension .NET Install Tool.
  • Git, terminal et conventions src/ / tests/.
dotnet --info
dotnet --list-sdks
dotnet new --list | grep web
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Workflow solution multi-projets

POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Structure de dépôt cible

booking-engine/
  BookingEngine.sln
  Directory.Packages.props
  src/
    Booking.Domain/
    Booking.Application/
    Booking.Infrastructure/
    Booking.Api/
  tests/
    Booking.Domain.Tests/
    Booking.Application.Tests/
  • Une arborescence explicite simplifie la montée en charge et les tests.
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Commandes indispensables

dotnet new sln -n BookingEngine
dotnet new classlib -n Booking.Domain -o src/Booking.Domain
dotnet new xunit -n Booking.Domain.Tests -o tests/Booking.Domain.Tests
dotnet sln add src/Booking.Domain tests/Booking.Domain.Tests
dotnet restore
dotnet build
dotnet test
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Dépendances et centralisation des versions

  • Le fichier .csproj décrit la cible, les références et les options du projet.
  • Directory.Packages.props évite les versions divergentes entre projets.
  • NuGet devient plus lisible et plus simple à maintenir.
<Project>
  <ItemGroup>
    <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
    <PackageVersion Include="xunit" Version="2.9.3" />
  </ItemGroup>
</Project>
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Développement itératif avec hot reload

  • dotnet watch run réduit le cycle modifier -> lancer -> observer.
  • Très utile pour API, console apps interactives et UI légères.
  • Le hot reload ne remplace pas les tests, il accélère le feedback local.
dotnet watch --project src/Booking.Api run
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com
POO Avancée & Architecture Logicielle avec C#

Checklist de sortie du module

  • Solution multi-projets créée.
  • Références de projets cohérentes.
  • Versions centralisées.
  • Build et tests exécutables sans IDE graphique.
POO Avancée & Architecture Logicielle avec C# - V0.0.2 - 11/03/2026 23:58 - Réda BOUREBABA r.bourebaba@ynov.com