Class Diagram in Visual Studio 2019 | Class Designer Getting Started

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back once again in this video we will look at how we can enable class diagrams inside the visual studio 2019 but before we get started please make sure you subscribe to the channel if you haven't so in visual studio 2019 class designer allows you to design visualize and refactor classes and other types we use the class diagrams to create and edit classes in your c sharp projects visual basic rc plus plus projects you can also use class diagrams to understand your project structure better or reorganize your code so with the class diagram you'll be able to design the design meaning you edit your projects code by editing the class diagram add new elements and delete unwanted ones your changes are reflected in code you can also visualize the visualize in the sense that you understand your project structure by viewing the class in your project on a diagram you can also customize your diagram so that you can focus on the project details that you care about the most this saves your diagram to use later for you can also save your diagram to use later for demonstration or documentation refactor you can override methods rename identifies refactor parameters and implement interfaces and abstract classes so enough of all the talking let's get to it then to be able to enable the clutch diagram first of all we need to download and install it so we can do that by opening a visual studio installer so i've got it here so if you if you get this page then you can click on the modify so once you get to this page click on individual components so you scroll down to code tools so once you get to these cultures you you check the class designer box right make sure you check on this box so once you check on this box you actually download and and install it i've already done it so there's no need for that so i'm just going to close this bit but once you get you're done with that bit then we can come inside the visual studio so we're just going to create a very simple console application for this example so i'm just going to click on the create a new project so here we're just going to make a c-sharp console application in it.net call click on the nest we're not going to configure anything here so we're just going to click on the create so while this is actually being created so the class diagrams shows the details of types for example their constituent members and the relationships between them the visualization of these entities is a dynamic view into the code this means that you can edit types in the designer and then see your edited reflected in the source code which i'm going to show you in a moment so what we would do is we're just going to create a very simple class so here we're just going to add a new class so we're just going to call it products so we're just going to make this class a public class and i'm just going to put very simple properties inside two properties so the int and then we've got um id so we've got this string and the name so we're just going to leave this bit here so now what we do next is we click on the project right click on the project and we come inside the add and then new item so here we're just going to leave here as visual c sharp item so here we're just going to type in class diagram so we're going to type in class diagram so as you can see here now we've got the class diagram being shown here we're not going to change any name so i'm just going to click on the add so now as you can see we've got the diagram added so we can add something by right clicking it here and then we can add the class enums interface abstract class struct for structure delegate and we can even add comments so in this case we're just going to add a class first so here we can configure the class details so here this cloud we're just going to call it category then we're going to leave it as public so we leave the file the file will be created as uh category.cs so once it's created so as you can see here for some reason i'm not having the the diagram being shown so i'm just gonna pause the video and re and create it again so just bear with me for a sec okay so i've had to reopen it so i'm just gonna open the designer again so here we're just gonna add a new class so we're going to call it category so as you can see here now we've got the category class here then we've got it created here as well so if we look at it here we've got this category here in the category here so we can open this bit here and add some properties so we can say so as you could as you can see whatever we we add in is being reflected straight on there on the left side so as you can see here now he's being reflected here straight away so we've here to we've got the products here so i'm just going to move it to this bit here so here to you can add the product by dragging and dropping it here so as you can see we've got the product here as well and now we've got a category so we can just going to create a very simple relationship between the category and the product so that we can view it so let's say the category has got um collection of products so okay yes say products and of course it's a get setter so you can say get set so as you can see here now we've got the products here so we can right click on the product and we and say show as association so as you can see here now we've got this bit here we're going to remove it and then here show as a collection so as you can see here we've got the category pointing to multiple products so we've got one a category that is actually linked to multiple products so we can also go inside a product and say public category say product category product category and it's of course it's a get setter so if we look here so we've got a product category so here too we can show as association so as you can see here now we've got the product categories here so you can go ahead and create multiple classes and you can also edit the class details here from here so as you can see we've got the name product category and whatnot so you can also delete it straight from this window so i will leave you here and i hope you actually continue further and explore more so once again if you haven't subscribed to the channel please make sure you do because i've got loads of videos coming up have a lovely morning afternoon evening wherever you are peace
Info
Channel: Hacked
Views: 147,790
Rating: undefined out of 5
Keywords: class diagram, class, uml, uml class diagram, uml class diagram tutorial, class diagram tutorial, class diagram visual studio 2019, class designer visual studio 2019, uml visual studio 2019, visual paradigm, c# class diagram, c++ class diagram, visual basic class diagram, c++ uml diagram, use case c#, c++ use case, software design, uml software design, softare ar
Id: syYyQ7LlcPc
Channel Id: undefined
Length: 9min 54sec (594 seconds)
Published: Wed Dec 30 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.