Skip to content

rsqb/SimpleComponents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Components Example

.NET C# License

Two components demonstrating .NET component interaction:

  • Dog.dll – Class library implementing IDog interface
  • Host.exe – Console app using Dog component

Architecture

graph TB

    subgraph "Host.exe"
        Host
        IFeeder[<i>IFeeder</i>]
        IDogHost[<i>IDogHost</i>]
        Host -.-> IFeeder
        Host -.-> IDogHost
    end

    subgraph "Dog.dll"
        Dog
        IDog[<i>IDog</i>]
        Dog -.-> IDog
    end

    Host --> IDog

    style IFeeder fill:#ffffcc,color:#333,stroke:#333,stroke-dasharray: 5 5
    style IDogHost fill:#ffffcc,color:#333,stroke:#333,stroke-dasharray: 5 5
    style IDog fill:#ffffcc,color:#333,stroke:#333,stroke-dasharray: 5 5
    style Host fill:#5C2D91,color:#fff,stroke:#333,stroke-width:2px
    style Dog fill:#512BD4,color:#fff,stroke:#333,stroke-width:2px
Loading
  • Dependency Inversion Principle
  • IDog interface – Defines dog behaviors:
    • Core: Bark, Growl, Bite, Run, WagTail
    • Others: DemandFood, LiftLeg
  • Dog class – Implements dog behaviors
  • IFeederFeeding responsibilities: GiveFood, GiveDrink, Call
  • IDogHostCare responsibilities: LeadAnimal, CareForAnimalFur
  • Host class implements both interfaces
  • Program – Main entry point with demonstration

Build & Run

# Build the solution
dotnet build

# Run the host application
dotnet run --project Host

Attribution

Based on tutorial by Professor V. Giedrimas, Vilnius University (Šiauliai Academy). Extended by:

  • Slightly enhanced interface design
  • Modern C# language features

Verifying Releases

All releases are signed with GPG (GNU Privacy Guard) key:

  • Fingerprint: B1FD 20DB 15EE D25F D6DE 7C93 C7CE 19DC DFD0 11BD
  • Public key: PUBLIC_KEY.asc or Gist

To verify:

# Import key
curl -L https://gist.github.com/rsqb/1bd8693e60027034031efade3c6ac95d/raw | gpg --import

# Verify signature
gpg --verify <release>.asc <release>

About

Two components demonstrating .NET component interaction

Topics

Resources

License

Stars

Watchers

Forks

Languages