{"id":24649043,"url":"https://github.com/mreshboboyev/fluent-builder-design-pattern","last_synced_at":"2025-10-10T13:07:53.978Z","repository":{"id":270654660,"uuid":"911049375","full_name":"MrEshboboyev/fluent-builder-design-pattern","owner":"MrEshboboyev","description":"A C# repository demonstrating the Fluent Builder design pattern, highlighting its advantages and differences compared to the traditional builder approach for creating complex objects.","archived":false,"fork":false,"pushed_at":"2025-02-27T11:14:32.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-10T13:07:53.631Z","etag":null,"topics":["asp-net-core","best-practices","builder-pattern","c-sharp","clean-code","design-pattern","fluent-builder-design-pattern","object-creation","oop","software-design","web-api"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrEshboboyev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-02T06:05:36.000Z","updated_at":"2025-02-27T11:14:35.000Z","dependencies_parsed_at":"2025-01-02T07:25:18.714Z","dependency_job_id":"ce84a16f-4749-40fb-b0c3-bb377a439ce7","html_url":"https://github.com/MrEshboboyev/fluent-builder-design-pattern","commit_stats":null,"previous_names":["mreshboboyev/fluent-builder-design-pattern"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MrEshboboyev/fluent-builder-design-pattern","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrEshboboyev%2Ffluent-builder-design-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrEshboboyev%2Ffluent-builder-design-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrEshboboyev%2Ffluent-builder-design-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrEshboboyev%2Ffluent-builder-design-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrEshboboyev","download_url":"https://codeload.github.com/MrEshboboyev/fluent-builder-design-pattern/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrEshboboyev%2Ffluent-builder-design-pattern/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004007,"owners_count":26083662,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","best-practices","builder-pattern","c-sharp","clean-code","design-pattern","fluent-builder-design-pattern","object-creation","oop","software-design","web-api"],"created_at":"2025-01-25T17:15:31.539Z","updated_at":"2025-10-10T13:07:53.917Z","avatar_url":"https://github.com/MrEshboboyev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fluent Builder Design Pattern in C#\n\nThis repository demonstrates the **Fluent Builder Design Pattern** in C#, showcasing how it differs from the traditional builder approach for creating complex objects. By using this pattern, developers can write cleaner, more readable, and more maintainable code for object construction.\n\n## 🚀 What is the Fluent Builder Pattern?\nThe Fluent Builder pattern is an advanced implementation of the Builder Design Pattern. It leverages **method chaining** to create objects step by step, allowing for a more readable and intuitive API. This approach is especially useful for constructing objects with numerous properties or configurations.\n\n### 🆚 Fluent Builder vs. Traditional Builder\n| Feature                 | Traditional Builder             | Fluent Builder                |\n|-------------------------|----------------------------------|--------------------------------|\n| **Readability**         | Step-by-step, more verbose      | Chainable, concise, intuitive |\n| **Ease of Use**         | Requires intermediate objects   | Streamlined with method chaining |\n| **Flexibility**         | Moderate customization          | Highly customizable with clean syntax |\n\n## 📂 Repository Structure\nThe repository contains:\n- **Examples of the traditional builder pattern**: Demonstrating the step-by-step approach.\n- **Examples of the fluent builder pattern**: Showcasing method chaining for a cleaner API.\n\n## 📖 Usage Guide\n### Step 1: Clone the Repository\n```bash\ngit clone https://github.com/MrEshboboyev/fluent-builder-design-pattern.git\ncd fluent-builder-design-pattern\n```\nStep 2: Open the Project\nOpen the project in your favorite C# IDE (e.g., Visual Studio).\n\nStep 3: Run the Examples\nRun the provided examples to see the differences between traditional and fluent builder patterns.\n\n🛠 Code Example\nHere’s a quick comparison:\n\nWithout Builder :\n```bash\nvar test = new Test\n    {\n        Id = Guid.NewGuid(),\n        TestName = createTestRequest.TestName,\n        Description = createTestRequest.Description,\n        StartDate = createTestRequest.StartDate,\n        EndDate = createTestRequest.EndDate,\n        IsActive = createTestRequest.IsActive,\n        Tags = createTestRequest.Tags,\n        Difficulty = createTestRequest.Difficulty,\n        MaxParticipants = createTestRequest.MaxParticipants,\n        Sections = createTestRequest.Sections.Select(s =\u003e new TestSection\n        {\n            Title = s.Title,\n            TimeLimit = s.TimeLimit,\n            QuestionCount = s.QuestionCount\n        }).ToList()\n    };\n```\nWith Builder : \n```bash\nvar test = new TestBuilder()\n        .WithBasicInfo(\n            createTestRequest.TestName,\n            createTestRequest.Description,\n            createTestRequest.StartDate,\n            createTestRequest.EndDate)\n        .WithIsActive(createTestRequest.IsActive)\n        .WithTags(createTestRequest.Tags)\n        .WithDifficulty(createTestRequest.Difficulty)\n        .WithMaxParticipants(createTestRequest.MaxParticipants)\n        .WithSections(createTestRequest.Sections)\n        .Build();\n```\n\n🌟 Benefits of the Fluent Builder Pattern\nImproved Readability: Code is easier to understand with method chaining.\nClean API: Reduces clutter and complexity in object creation.\nExtensibility: Easily extendable for future requirements.\n🏗 About the Author\nThis repository was created by MrEshboboyev, showcasing modern design patterns and best practices in software development.\n\n📄 License\nThis project is licensed under the MIT License. Feel free to use and adapt the code in your own projects.\n\n🔖 Tags\nC#, Fluent Builder, Design Patterns, Builder Pattern, Object Creation, Clean Code, OOP, Best Practices\n\nFeel free to customize this further based on your specific needs or add additional examples. Let me know if you’d like to refine or expand any section! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmreshboboyev%2Ffluent-builder-design-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmreshboboyev%2Ffluent-builder-design-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmreshboboyev%2Ffluent-builder-design-pattern/lists"}