This project was developed as part of a design pattern course, where it received a high score of 85/100. It is a restaurant application designed to streamline the process of ordering food from restaurants.
Users can browse through a selection of available food items, choose the items they want to purchase, specify the quantity, and complete the purchase seamlessly within the application.
Abstract Factory: Used to provide an interface for creating families of related or dependent objects without specifying their concrete classes. In this application, it was utilized to create a template menu to be used by all restaurants, ensuring consistency and ease of management.
Factory Method: Implemented to define an interface for creating an object, but allowing subclasses to alter the type of objects that will be created. Here, it was used to create restaurants with the same attributes (e.g., name, rating, address) but with different values, thereby accommodating variations among different restaurants.
Decorator: Utilized to dynamically add new functionalities to objects without altering their structure. In this application, it was used to customize sandwiches by adding ingredients and updating the price accordingly.
NotificationBaseSender: Implemented to provide a base class for sending notifications, allowing for easy extension and customization of notification-sending functionalities.
└── CSharp-Design-Patterns/
├── App
│ ├── AFMenu
│ │ └── IMenuFactory.cs
│ ├── APMenu
│ │ └── Menu.cs
│ ├── App.csproj
│ ├── App.csproj.user
│ ├── BledorForm.Designer.cs
│ ├── BledorForm.cs
│ ├── BledorForm.resx
│ ├── CCSandwich
│ │ ├── BeefSandwich.cs
│ │ ├── ChickenSandwich.cs
│ │ └── TunaSandwich.cs
│ ├── CDSandwich
│ │ ├── Cheese.cs
│ │ ├── bacon.cs
│ │ ├── sauce.cs
│ │ └── tomato.cs
│ ├── CFMenu
│ │ ├── BledorMenu.cs
│ │ ├── MiniBMenu.cs
│ │ └── PizzeriaMenu.cs
│ ├── CFRestaurent
│ │ ├── RestaurentBurger.cs
│ │ ├── RestaurentDessert.cs
│ │ ├── RestaurentPizza.cs
│ │ └── RestaurentSub.cs
│ ├── CPMenu
│ │ ├── BledorSaltM.cs
│ │ ├── BledorSweetM.cs
│ │ ├── MiniBSaltM.cs
│ │ ├── MiniBSweetM.cs
│ │ ├── PizzeriaSaltM.cs
│ │ └── PizzeriaSweetM.cs
│ ├── CPRestaurent
│ │ ├── MiniB.cs
│ │ ├── Pizzeria.cs
│ │ ├── Subway.cs
│ │ └── bledor.cs
│ ├── CSandwich
│ │ └── Sandwich.cs
│ ├── DSandwich
│ │ └── SandwichAddon.cs
│ ├── EmailNotificationSender.cs
│ ├── FBRestaurent
│ │ └── IRestaurentFactory.cs
│ ├── Food.cs
│ ├── Message.cs
│ ├── MessageNotificationSender.cs
│ ├── MiniBForm.Designer.cs
│ ├── MiniBForm.cs
│ ├── MiniBForm.resx
│ ├── NotificatonBaseSender
│ │ └── NotificationSenderBase.cs
│ ├── OrderForm.Designer.cs
│ ├── OrderForm.cs
│ ├── OrderForm.resx
│ ├── PBRestaurent
│ │ └── Restaurent.cs
│ ├── Person.cs
│ ├── PizzeriaForm.Designer.cs
│ ├── PizzeriaForm.cs
│ ├── PizzeriaForm.resx
│ ├── Program.cs
│ ├── Properties
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── RInterface.Designer.cs
│ ├── RInterface.cs
│ ├── RInterface.resx
│ ├── Resources
│ │ ├── Pizzeria-logo.jpg
│ │ ├── Samsung - Notification Tone.wav
│ │ ├── bledor-logo.png
│ │ ├── logo-burger.jpg
│ │ ├── samsung_letter.wav
│ │ └── subway-logo.jpg
│ ├── SubwayForm.Designer.cs
│ ├── SubwayForm.cs
│ ├── SubwayForm.resx
│ ├── bin
│ │ └── Debug
│ │ ├── net5.0-windows
│ │ │ ├── App.deps.json
│ │ │ ├── App.dll
│ │ │ ├── App.exe
│ │ │ ├── App.pdb
│ │ │ ├── App.runtimeconfig.dev.json
│ │ │ ├── App.runtimeconfig.json
│ │ │ └── ref
│ │ └── net7.0-windows
│ │ ├── App.deps.json
│ │ ├── App.dll
│ │ ├── App.exe
│ │ ├── App.pdb
│ │ └── App.runtimeconfig.json
│ └── obj
│ ├── App.csproj.nuget.dgspec.json
│ ├── App.csproj.nuget.g.props
│ ├── App.csproj.nuget.g.targets
│ ├── Debug
│ │ ├── net5.0-windows
│ │ │ ├── .NETCoreApp,Version=v5.0.AssemblyAttributes.cs
│ │ │ ├── App.AssemblyInfo.cs
│ │ │ ├── App.AssemblyInfoInputs.cache
│ │ │ ├── App.BledorForm.resources
│ │ │ ├── App.GeneratedMSBuildEditorConfig.editorconfig
│ │ │ ├── App.MiniBForm.resources
│ │ │ ├── App.OrderForm.resources
│ │ │ ├── App.PizzeriaForm.resources
│ │ │ ├── App.Properties.Resources.resources
│ │ │ ├── App.RInterface.resources
│ │ │ ├── App.SubwayForm.resources
│ │ │ ├── App.assets.cache
│ │ │ ├── App.csproj.AssemblyReference.cache
│ │ │ ├── App.csproj.CoreCompileInputs.cache
│ │ │ ├── App.csproj.FileListAbsolute.txt
│ │ │ ├── App.csproj.GenerateResource.cache
│ │ │ ├── App.designer.deps.json
│ │ │ ├── App.designer.runtimeconfig.json
│ │ │ ├── App.dll
│ │ │ ├── App.genruntimeconfig.cache
│ │ │ ├── App.pdb
│ │ │ ├── TempPE
│ │ │ ├── apphost.exe
│ │ │ └── ref
│ │ └── net7.0-windows
│ │ ├── .NETCoreApp,Version=v7.0.AssemblyAttributes.cs
│ │ ├── App.AssemblyInfo.cs
│ │ ├── App.AssemblyInfoInputs.cache
│ │ ├── App.BledorForm.resources
│ │ ├── App.GeneratedMSBuildEditorConfig.editorconfig
│ │ ├── App.MiniBForm.resources
│ │ ├── App.OrderForm.resources
│ │ ├── App.PizzeriaForm.resources
│ │ ├── App.Properties.Resources.resources
│ │ ├── App.RInterface.resources
│ │ ├── App.SubwayForm.resources
│ │ ├── App.assets.cache
│ │ ├── App.csproj.BuildWithSkipAnalyzers
│ │ ├── App.csproj.CoreCompileInputs.cache
│ │ ├── App.csproj.FileListAbsolute.txt
│ │ ├── App.csproj.GenerateResource.cache
│ │ ├── App.designer.deps.json
│ │ ├── App.designer.runtimeconfig.json
│ │ ├── App.dll
│ │ ├── App.genruntimeconfig.cache
│ │ ├── App.pdb
│ │ ├── apphost.exe
│ │ ├── ref
│ │ └── refint
│ ├── project.assets.json
│ └── project.nuget.cache
└── App.sln.
| File | Summary |
|---|---|
| App.sln | ► INSERT-TEXT-HERE |
App
| File | Summary |
|---|---|
| SubwayForm.cs | ► INSERT-TEXT-HERE |
| RInterface.cs | ► INSERT-TEXT-HERE |
| SubwayForm.resx | ► INSERT-TEXT-HERE |
| Food.cs | ► INSERT-TEXT-HERE |
| RInterface.Designer.cs | ► INSERT-TEXT-HERE |
| EmailNotificationSender.cs | ► INSERT-TEXT-HERE |
| RInterface.resx | ► INSERT-TEXT-HERE |
| BledorForm.resx | ► INSERT-TEXT-HERE |
| PizzeriaForm.resx | ► INSERT-TEXT-HERE |
| SubwayForm.Designer.cs | ► INSERT-TEXT-HERE |
| OrderForm.cs | ► INSERT-TEXT-HERE |
| App.csproj.user | ► INSERT-TEXT-HERE |
| PizzeriaForm.cs | ► INSERT-TEXT-HERE |
| OrderForm.Designer.cs | ► INSERT-TEXT-HERE |
| App.csproj | ► INSERT-TEXT-HERE |
| BledorForm.Designer.cs | ► INSERT-TEXT-HERE |
| MessageNotificationSender.cs | ► INSERT-TEXT-HERE |
| Message.cs | ► INSERT-TEXT-HERE |
| MiniBForm.cs | ► INSERT-TEXT-HERE |
| Person.cs | ► INSERT-TEXT-HERE |
| MiniBForm.Designer.cs | ► INSERT-TEXT-HERE |
| OrderForm.resx | ► INSERT-TEXT-HERE |
| Program.cs | ► INSERT-TEXT-HERE |
| MiniBForm.resx | ► INSERT-TEXT-HERE |
| BledorForm.cs | ► INSERT-TEXT-HERE |
| PizzeriaForm.Designer.cs | ► INSERT-TEXT-HERE |
App.FBRestaurent
| File | Summary |
|---|---|
| IRestaurentFactory.cs | ► INSERT-TEXT-HERE |
App.AFMenu
| File | Summary |
|---|---|
| IMenuFactory.cs | ► INSERT-TEXT-HERE |
App.CFRestaurent
| File | Summary |
|---|---|
| RestaurentSub.cs | ► INSERT-TEXT-HERE |
| RestaurentBurger.cs | ► INSERT-TEXT-HERE |
| RestaurentDessert.cs | ► INSERT-TEXT-HERE |
| RestaurentPizza.cs | ► INSERT-TEXT-HERE |
App.DSandwich
| File | Summary |
|---|---|
| SandwichAddon.cs | ► INSERT-TEXT-HERE |
App.obj
| File | Summary |
|---|---|
| App.csproj.nuget.g.targets | ► INSERT-TEXT-HERE |
| App.csproj.nuget.g.props | ► INSERT-TEXT-HERE |
| App.csproj.nuget.dgspec.json | ► INSERT-TEXT-HERE |
| project.assets.json | ► INSERT-TEXT-HERE |
App.obj.Debug.net5.0-windows
| File | Summary |
|---|---|
| App.AssemblyInfo.cs | ► INSERT-TEXT-HERE |
| App.csproj.FileListAbsolute.txt | ► INSERT-TEXT-HERE |
| App.designer.deps.json | ► INSERT-TEXT-HERE |
| App.GeneratedMSBuildEditorConfig.editorconfig | ► INSERT-TEXT-HERE |
| App.designer.runtimeconfig.json | ► INSERT-TEXT-HERE |
| .NETCoreApp,Version=v5.0.AssemblyAttributes.cs | ► INSERT-TEXT-HERE |
App.obj.Debug.net7.0-windows
| File | Summary |
|---|---|
| App.AssemblyInfo.cs | ► INSERT-TEXT-HERE |
| App.csproj.FileListAbsolute.txt | ► INSERT-TEXT-HERE |
| App.designer.deps.json | ► INSERT-TEXT-HERE |
| App.GeneratedMSBuildEditorConfig.editorconfig | ► INSERT-TEXT-HERE |
| .NETCoreApp,Version=v7.0.AssemblyAttributes.cs | ► INSERT-TEXT-HERE |
| App.designer.runtimeconfig.json | ► INSERT-TEXT-HERE |
| App.csproj.BuildWithSkipAnalyzers | ► INSERT-TEXT-HERE |
App.APMenu
| File | Summary |
|---|---|
| Menu.cs | ► INSERT-TEXT-HERE |
App.PBRestaurent
| File | Summary |
|---|---|
| Restaurent.cs | ► INSERT-TEXT-HERE |
App.CPRestaurent
| File | Summary |
|---|---|
| Pizzeria.cs | ► INSERT-TEXT-HERE |
| bledor.cs | ► INSERT-TEXT-HERE |
| MiniB.cs | ► INSERT-TEXT-HERE |
| Subway.cs | ► INSERT-TEXT-HERE |
App.CDSandwich
| File | Summary |
|---|---|
| tomato.cs | ► INSERT-TEXT-HERE |
| sauce.cs | ► INSERT-TEXT-HERE |
| bacon.cs | ► INSERT-TEXT-HERE |
| Cheese.cs | ► INSERT-TEXT-HERE |
App.NotificatonBaseSender
| File | Summary |
|---|---|
| NotificationSenderBase.cs | ► INSERT-TEXT-HERE |
App.CFMenu
| File | Summary |
|---|---|
| BledorMenu.cs | ► INSERT-TEXT-HERE |
| PizzeriaMenu.cs | ► INSERT-TEXT-HERE |
| MiniBMenu.cs | ► INSERT-TEXT-HERE |
App.bin.Debug.net5.0-windows
| File | Summary |
|---|---|
| App.deps.json | ► INSERT-TEXT-HERE |
| App.runtimeconfig.json | ► INSERT-TEXT-HERE |
| App.runtimeconfig.dev.json | ► INSERT-TEXT-HERE |
App.bin.Debug.net7.0-windows
| File | Summary |
|---|---|
| App.deps.json | ► INSERT-TEXT-HERE |
| App.runtimeconfig.json | ► INSERT-TEXT-HERE |
App.Properties
| File | Summary |
|---|---|
| Resources.resx | ► INSERT-TEXT-HERE |
| Resources.Designer.cs | ► INSERT-TEXT-HERE |
App.CCSandwich
| File | Summary |
|---|---|
| ChickenSandwich.cs | ► INSERT-TEXT-HERE |
| BeefSandwich.cs | ► INSERT-TEXT-HERE |
| TunaSandwich.cs | ► INSERT-TEXT-HERE |
App.CSandwich
| File | Summary |
|---|---|
| Sandwich.cs | ► INSERT-TEXT-HERE |
App.CPMenu
| File | Summary |
|---|---|
| BledorSweetM.cs | ► INSERT-TEXT-HERE |
| MiniBSaltM.cs | ► INSERT-TEXT-HERE |
| BledorSaltM.cs | ► INSERT-TEXT-HERE |
| PizzeriaSweetM.cs | ► INSERT-TEXT-HERE |
| MiniBSweetM.cs | ► INSERT-TEXT-HERE |
| PizzeriaSaltM.cs | ► INSERT-TEXT-HERE |
- Clone the CSharp-Design-Patterns repository:
git clone https://github.com/ghadyg/CSharp-Design-Patterns- Change to the project directory:
cd CSharp-Design-Patterns- Open the solution
App.sln- Change to the project directory:
cd CSharp-Design-Patterns\App\App\bin\Debug\net7.0-windows- Run the App:
App.exe