2

I'm studying design patterns. I wondered what the design pattern of the project was basically created when I created the WinFoam project in the Visual Studio. what is the design pattern of winform when I create new winform project in visual studio?

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
HyunBin
  • 45
  • 5
  • It's *boilerplate* :) – Jimi Jan 26 '23 at 00:48
  • free standing monolith – pm100 Jan 26 '23 at 00:50
  • You need to implement architectural patterns for your application based on your requirement. But if you'd like to know what design patterns has been used in .NET Framework, take a look at [What design patterns are used throughout the .NET Framework?](https://stackoverflow.com/q/3252499/3110834). Also in WinForms, you can see Composite (controls), Observer (Events), Prototype (all clonable things like DataGridViewColumn, ...), Iterator (all collections like Controls), Adapter (working with COM, or Windows API), Fecade (controls, modals, etc.), ... – Reza Aghaei Jan 26 '23 at 15:15

1 Answers1

1

I suppose that no pattern is used for Form1.Designer.cs and Form1.cs. It is just boilerplate code. As wiki says:

In computer programming, boilerplate code, or simply boilerplate, are sections of code that are repeated in multiple places with little to no variation.

However, when you are creating handler for button click, then Observer pattern is used to connect button and its handler.

StepUp
  • 36,391
  • 15
  • 88
  • 148