Skip to content

Releases: 8T4/c4sharp

Release v7.0.x

17 Mar 01:53
0755359
Compare
Choose a tag to compare

Wellcome C4Sharp 7.0.x 🚀

⚠️ Attention: breaking changes

A change in one part of this version could cause other components to fail; Not possible to fix old entries without a breaking change, so remap old to new in import lib.

📦 Release

We released a new version of C4Sharp. The release includes minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

New base class for DiagramBuildRunner

Now C4Sharp has new specific Builders:

  • ContainerDiagram
  • ComponentDiagram
  • SoftwareSystemDiagram
  • ContextDiagram
  • SequenceDiagram
  • DeploymentDiagram

syntax improvement

We improved syntax to create a new diagram from scratch

public class ContainerDiagramSample: ContainerDiagram
{
    protected override string Title => "Container diagram for Internet Banking System";

    protected override IEnumerable<Structure> Structures => new Structure[]
    {
        Person.None | Boundary.External 
                    | ("Customer", "Personal Banking Customer", "A customer of the bank, with personal bank accounts."),
        
        SoftwareSystem.None | ("BankingSystem", "Internet Banking System", 
            "Allows customers to view information about their bank accounts, and make payments."),
        
        SoftwareSystem.None | Boundary.External 
                            | ("MailSystem", "E-mail system", "The internal Microsoft Exchange e-mail system."),
        
        Bound("c1", "Internet Banking",
            Container.None | (WebApplication, "WebApp", "WebApp", "C#, WebApi", 
                "Delivers the static content and the Internet banking SPA"),
            
            Container.None | (Spa, "Spa", "Spa", "JavaScript, Angular", 
                "Delivers the static content and the Internet banking SPA"),
            
            Container.None | (Mobile, "MobileApp", "Mobile App", "C#, Xamarin", 
                "Provides a mobile banking experience"),
            
            Container.None | (Database, "SqlDatabase", "SqlDatabase", "SQL Database", 
                "Stores user registration information, hashed auth credentials, access logs, etc."),   
            
            Container.None | (Queue, "RabbitMQ", "RabbitMQ", "RabbitMQ", 
                "Stores user registration information, hashed auth credentials, access logs, etc."),
            
            Container.None | (Api, "BackendApi", "BackendApi", "Dotnet, Docker Container", 
                "Provides Internet banking functionality via API.")
        )
    };

    protected override IEnumerable<Relationship> Relationships => new[]
    {
        this["Customer"] > this["WebApp"] | ("Uses", "HTTPS"),
        this["Customer"] > this["Spa"] | ("Uses", "HTTPS"),
        this["Customer"] > this["MobileApp"] | "Uses",
        
        this["WebApp"] > this["Spa"] | "Delivers" | Position.Neighbor,
        this["Spa"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"),
        this["MobileApp"] > this["BackendApi"] | ("Uses", "async, JSON/HTTPS"),
        this["SqlDatabase"] < this["BackendApi"] | ("Uses", "async, JSON/HTTPS") | Position.Neighbor,
        this["RabbitMQ"] < this["BackendApi"] | ("Uses", "async, JSON"),
        
        this["Customer"] < this["MailSystem"] | "Sends e-mails to",
        this["MailSystem"] < this["BackendApi"] | ("Sends e-mails using", "sync, SMTP"),
        this["BackendApi"] > this["BankingSystem"] | ("Uses", "sync/async, XML/HTTPS") | Position.Neighbor
    };
}

New compilation

Now you don't need to call the method .Build() explicitly

using C4Sharp.Diagrams;
using C4Sharp.Diagrams.Plantuml;
using C4Sharp.Diagrams.Themes;
using ModelDiagrams.Diagrams;

var diagrams = new DiagramBuilder[]
{
    new ContextDiagramSample(),
    new ComponentDiagramSample(),
    new ContainerDiagramSample(),
    new EnterpriseDiagramSample(),
    new SequenceDiagramSample(),
    new DeploymentDiagramSample()
};

var path = Path.Combine("..", "..", "..", "..", "..", "docs", "images");
        
new PlantumlContext()
    .UseDiagramImageBuilder()
    .Export(path, diagrams, new DefaultTheme());

Wellcome Themes

You can use themes to customize your diagrams.

new PlantumlContext()
    .UseDiagramImageBuilder()
    .Export(path, diagrams, new DefaultTheme());

Boundary Style

New methods to customize Boundaries

public IBoundaryStyle? BoundaryStyle => new BoundaryStyle()
        .UpdateBoundaryStyle(ElementName.System, "#FFFFFF", "#000000", "#000000", false, Shape.RoundedBoxShape)
        .UpdateBoundaryStyle(ElementName.Container, "#FFFFFF", "#000000", "#000000", false, Shape.RoundedBoxShape)
        .UpdateBoundaryStyle(ElementName.Enterprise, "#FFFFFF", "#000000", "#000000", false, Shape.RoundedBoxShape);

New Sample Project

See the new sample project

What's Changed

Full Changelog: v6.2.x...v7.0.x

Release 6.2.x

01 Mar 02:36
b23edbe
Compare
Choose a tag to compare

C4Sharp version 6.2.x is released 🚀

⚠️ Attention: breaking changes

A change in one part of this version could cause other components to fail; Not possible to fix old entries without a breaking change, so remap old to new in import lib.

📦 Release

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Commits on Dec 25, 2022

  • Fixing NameSpaces (Please update your project to use the correct namespaces)
  • Update plantuml.jar
  • Update C4-plantuml files in Resource
  • Add new SequenceDiagram See the sample

image

  • Update ElementStyle.cs to accept UpdateElementStyle(...,?borderStyle, ?borderThickness)
  • Removing support to .NET 5.0

Release 6.0.x

26 Dec 03:00
8f607d4
Compare
Choose a tag to compare

C4Sharp version 6.0.x is released 🚀

⚠️ Attention: breaking changes

A change in one part of this version could cause other components to fail; Not possible to fix old entries without a breaking change, so remap old to new in import lib.

📦 Release

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Commits on Dec 25, 2022

🐞 Bugs

Commits on Dec 26, 2022

Release 4.1.x

20 Dec 17:51
6073e36
Compare
Choose a tag to compare

C4Sharp version 4.1.x is released 🚀

image

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

  • Update resource files
  • Remove unnecessary namespaces
  • Using instance name for container
  • Enabling Diagrams to use tags and styles elements.
  • ElementStyle
  • ElementTag
  • RelTab

Improvements 😎

Using instance name for container

Now, is possible create new container instances by name:

Containers.OracleDatabase[1];
Containers.OracleDatabase["Data Reader"];

see how to create new container instances by name in this sample code.

Custom tags/stereotypes support and skinparam updates

Now, C4Sharp provides new structures to customize diagram elements using C4-Plantuml methods such as:

  • AddElementTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape) : Introduces a new element tag. The styles of the tagged elements are updated and the tag is displayed in the calculated legend.

  • AddRelTag(tagStereo, ?textColor, ?lineColor, ?lineStyle) : Introduces a new relation tag. The styles of the tagged relations are updated and the tag is displayed in the calculated legend.

  • UpdateElementStyle(elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape) : This call updates the default style of the elements (component, ...) and creates no additional legend entry.

Using customization elements

see in the following code how to use customization structures:

internal static class Program
{
    // Elements customization
    private static readonly ElementStyle Style = new ElementStyle()
        .UpdateElementStyle(ElementName.ExternalPerson, "#7f3b08", "#7f3b08")
        .UpdateElementStyle(ElementName.Person, "#55ACEE", "#55ACEE")
        .UpdateElementStyle(ElementName.ExternalSystem, "#3F6684", shape: Shape.RoundedBoxShape);

    // Relationship customization
    private static readonly RelationshipTag Reltags = new RelationshipTag()
        .AddRelTag("error", "red", "red", LineStyle.DashedLine);

    // Tagged elements customization
    private static readonly ElementTag Tags = new ElementTag()
        .AddElementTag("services", "#3F6684", shape: Shape.EightSidedShape);
    
    private static void Main()
    {
        var diagrams = new []
        {
            ContextDiagramBuilder.Build().SetStyle(Style).SetRelTags(Reltags), //update element style
            ContainerDiagramBuilder.Build().SetTags(Tags), //set tagged elements customization
            ComponentDiagramBuilder.Build(),
            DeploymentDiagramBuilder.Build(),
            EnterpriseDiagramBuilder.Build().SetStyle(Style), // update element style
        };
        new PlantumlSession()
            .UseDiagramImageBuilder()
            .UseDiagramSvgImageBuilder()
            .UseStandardLibraryBaseUrl()
            .Export(diagrams);
    }
}

Tagging diagram structures and relationships

see in the following code how to tagging diagram structures and relationships:

// Tagging the structure
public static SoftwareSystem BankingSystem =>  new SoftwareSystem("BankingSystem", "Internet Banking System")
{
    Description = "Allows customers to view information about their bank accounts, and make payments.",
    Tags = new []{ "services" }
 };

return new ContextDiagram()
{
    Title = "System Context diagram for Internet Banking System",
    Structures = new Structure[]
    {
        Customer,
        BankingSystem,
        Mainframe,
        MailSystem
    },
    Relationships = new[]
    {
        (Customer > BankingSystem).AddTags("error"), // Tagging the relationships
        (Customer < MailSystem)["Sends e-mails to"],
        (BankingSystem > MailSystem)["Sends e-mails", "SMTP"][Neighbor],
        BankingSystem > Mainframe,
    }
};

system-context-diagram-for-internet-banking-system-c4context

See more in our sample code

Release 4.0.x

20 Nov 17:09
3899fee
Compare
Choose a tag to compare

C4Sharp version 4.0.x is released 🚀

image

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

  • Using Smetana instead GraphViz/Dot - see more
  • Improve abstraction of C4SharpDirectory.cs class
  • Enable Nullable Warning
  • Improve abstraction of PlantumlResources.cs class
  • Improve PlantumlSession.cs responsibility
  • Improve Abstraction of Plantuml module

Break changes ⚠️

C4Sharp.Models.Plantuml.IO

Now, the PlantumlSession class was moved to namespace C4Sharp.Models.Plantuml.IO.

Improvements 😎

Now, the integration tests are running in GitHub actions

See more in our sample code

Release 3.2.121

18 Nov 00:18
5f0008a
Compare
Choose a tag to compare

C4Sharp version 3.2.121 is released 🚀

image

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

  • Adding Memory Stream Generator
  • Adding Enterprise Boundary Structure
  • Moving Resource Files to .c4s Directory
  • Adding SVG File Generator (thank you @Nino-Dioses 🤝 )
  • Removing Unnecessary Code (💩)

Break changes ⚠️

Moving Resource Files to .c4s Directory

Now, the resource files are saved separately from your diagram files.

Screen Shot 2021-11-17 at 21 07 33

Thank you, @Lowpoc!!!

Improvements 😎

Adding Memory Stream Generator

Now the Session has a method 'GetStream' that generate a Stream of Diagram

var diagram = ContextDiagramBuilder.Build() with { Title = "Diagram" };
var session = new PlantumlSession();
var (filename, results) = session.GetStream(diagram);

Adding Enterprise Boundary Structure

Now, C4Sharp has the Enterprise Boundary Structure :

public static ContextDiagram Build()
{
    return new ()
    {
        Title = "System Enterprise diagram for Internet Banking System",
        Structures = new Structure[]
        {
            Customer,
            new EnterpriseBoundary("eboundary", "Domain A")
            {
                Structures = new Structure []
                {
                    BankingSystem,   
                    new EnterpriseBoundary("eboundary1", "Domain Internal Users")
                    {
                        Structures = new Structure []
                        {
                            InternalCustomer,
                        }
                    },                             
                    new EnterpriseBoundary("eboundary2", "Domain Managers")
                    {
                        Structures = new Structure []
                        {
                            Manager,
                        }
                    },                            
                }
            },
            Mainframe,
            MailSystem
        },
        Relationships = new[]
        {
            Customer > BankingSystem,
            InternalCustomer > BankingSystem,
            Manager > BankingSystem,
            (Customer < MailSystem)["Sends e-mails to"],
            (BankingSystem > MailSystem)["Sends e-mails", "SMTP"][Neighbor],
            BankingSystem > Mainframe,
        }
    };
}        

image

Adding SVG File Generator

Now, you can build SVG images as well as PNG image files

new PlantumlSession()
    .UseDiagramImageBuilder()
    .UseDiagramSvgImageBuilder()
    .UseStandardLibraryBaseUrl()
    .Export(diagrams);

Thank you, @Nino-Dioses!!!

See more in our sample code

Release 3.0.115

08 Nov 14:47
Compare
Choose a tag to compare

C4Sharp version 3.0.115 is released 🚀

image

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Improvements 😎

  • Allow PluntSession to execute RELATIVE_INCLUDE as an argument.
  • Porting to dotnet 5.0
  • Fixing export method with path
  • Fixing PlantumlSession.cs to use StandardUrl
  • Change Model classes to record types
  • Adding Testing project 🥳
  • Removing unused methods
  • Fixing Methods documentation
  • rebranding logo

Break changes ⚠️

Configure PlantumlSession

Now the Export method is an extension method of PlantumlSession

new PlantumlSession()
    .UseDiagramImageBuilder() 
    .UseStandardLibraryBaseUrl()
    .Export(diagrams);
  • But, if you want to use the C4-PlantUML up-to-date version from their repo use this method UseStandardLibraryBaseUrl()
  • To save the *.png files you should use the method UseDiagramImageBuilder()

Instanciating Structures

Now the structure instantiation should be more explicit like this:

public static Person Customer => new Person("customer", "Personal Banking Customer")
{
    Description = "A customer of the bank, with personal bank accounts."
};

// Systems
public static SoftwareSystem BankingSystem => new SoftwareSystem("BankingSystem", "Internet Banking System")
{
    Description = "Allows customers to view information about their bank accounts, and make payments."
};

public static SoftwareSystem Mainframe => new SoftwareSystem("Mainframe", "Mainframe Banking System")
{
    Description = "Stores all of the core banking information about customers, accounts, transactions, etc.",
    Boundary = Boundary.External
};

public static SoftwareSystem MailSystem => new SoftwareSystem("MailSystem", "E-mail system")
{
    Description = "The internal Microsoft Exchange e-mail system.",
    Boundary = Boundary.External
};

See more in our sample code

Release v2.2.1

07 Jul 18:29
Compare
Choose a tag to compare

C4Sharp version 2.2.1 is released 🚀

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Fixing

We found a bug 🐛! The internal C4 files include the gist URL. In some network restriction contexts, it's not possible to generate the files. In this version, these bin files reference the RELATIVE_INCLUDE behavior.

Release v2.2.0

06 Jun 14:26
0c33a25
Compare
Choose a tag to compare

C4Sharp version 2.2.0 is released 🚀

We released a new version of C4Sharp. The release includes new improvements such as minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Improvement

We realized that there's already a built-in way to include .puml files from the standard library: https://github.com/plantuml/plantuml-stdlib, using <[LibraryName]/[FileName]> syntax.

This switches out the URL include for the cleaner syntax, and it will work the same as the URL include on any PlantUML diagram generator that's using an official PlantUML version.

Thanks 🤝

Thanks, @BenRStutzman for these amazing features and improvements on C4Sharp

Release v2.1.0

25 May 02:48
Compare
Choose a tag to compare

C4Sharp version 2.1.0 is released 🚀

We released a new version of C4Sharp. The release includes new improvements which include minor bug fixes to the write test log, code maintainability, and performance. You can read the full list of new enhancements and bug fixes below:

Fixing

  • Make PlantumlDiagram public so that its ToPumlString method is accessible from outside of this library - it's useful for creating a puml string when you don't want to save it to a file or export it to a PNG (for example, in my project I want to post the puml string to an external server, so all I need is the string).

New Features

  • Add an optional parameter, useUrlInclude, to the ToPumlString() method. If set to true, it will change the include statement at the beginning of the puml string to link to the current PlantUML standard library file on github, instead of to a local .puml file.

API changes

  • Add a Link property to the Structure class and new structure constructors with link parameters, and edit the ToPumlString() methods so that structures in diagrams can link to URLs.

Thanks 🤝

Thanks, @BenRStutzman for these amazing features and improvements on C4Sharp