Alrighty, let's talk about an important part about creating a great code documentation and therefore
you want to use this summary.
So just like a comment you add four words here or slashes three in total.
This will create a summary inside of the summary.
You now want to go ahead and describe the customer class object as good as possible.
For example, represents a customer with id and name.
Great.
You can also just write it in the correct case with id and name.
So when is this important or when will it become visible?
You know, most of the time you want to use this when you develop your own frameworks or libraries,
when other developers are using what you have created.
Here's an example.
If we now hover above customer, he will provide us with a string that we have entered here as the description.
As the summary.
If we hover above it, you can see represents the customer with ID and name, which is exactly what
we have right here.
So if I'm in another file and I cannot see that right.
So let's just assume that we would be right here.
Just create another class.
Add a class I would just call it a test class.
Totally fine test dot CSS.
There we go.
And inside of that class I have a void.
Call it main.
And here I want to use my customer.
Now I can use customer.
And then during development I don't have to switch to the other file to see what the customer is doing,
because I can simply hover above it and can see represents a customer with ID and name.
All right.
So you can simply see the summary here while you are developing in another file okay.
So in order to keep everything as easy as possible for you to follow along, I will move on from the
program void main later on to use this to show the summary.
But for sure this works from every every other file too, right?
Great.
So this is the summary on the level of a class.
You can use it for sure for everything, no matter if it's an interface, a class or whatever.
Same applies for properties.
So we can also use this inside of our interfaces and classes.
So whatever we want to describe summary.
Here we have a property gets the ID of the customer.
Now here please pay attention.
It only gets the ID because this is a get only property.
I don't want to be able to set the property from outside.
You know it's public.
So I want to protect that information.
So it's get only here for this, uh, second property we want to say gets or sets the name of the customer.
There we go.
So again, if we would be in another file or another class and we want to use a customer, go ahead
and say customer.
If I hover above that you can see, okay, this is my summary of the class new customer and so on.
And I then want to use customer.id for example, if I go to that property you can see that it tells
me gets the ID of the customer.
So it tells me okay, I will get the ID if I want to use the name.
Here you can see gets or sets the name of the customer.
So by using summaries you can help other developers or yourself to understand what's going on and provide
additional information while they are developing because they can see the summary while they're using
your classes, your methods, and so on.
Great.
So that's summary for class and properties.
In addition to this, we can also do that for methods that have params constructor for example, and
so on and so forth.
So again we could create a summary here.
Let's just do that for the customer service provides functionalities for handling customers.
And here I can remove that dot.
And here for the method.
And that's the important part.
Now we can write down the params.
You can see a param here bound by the name argument here to the parameter.
So customer id if we would rename it to id for example, we would have to rename the param here to id
just keep that in sync.
So for example the ID for the customer to retrieve.
And then finally we can also describe what's going on for return here.
So what does this method return.
Let's write down returns the customer found by id whatever returns the customer from by ID totally fine.
You know, if we now want to use that, we can use our customer service.
Let's create the service.
And then if we hover above that we can see the summary provides functionalities for handling customers.
Then we can call the service dot.
And now for example get customer by ID right gets the customer by id we have our parameter here.
And then if I develop and add the parameter here for example gets the customer by ID and I can simply
put in any ID, for example one here and use it that way.
And while I've developed that, you can see that I can even see what it returns.
Return the customer or returns the customer found by ID.
So for sure I don't want to add any spelling mistakes here, right?
So returns the customer phone by ID.
Alrighty, now you can also do this for the same customer here, but that was just for demonstration
purposes.
We got our todo here.
So I think you understand what these kind of summary comments are.
You know they are written in XML because we can, as you can see here, use some arguments and some
well additional tags to provide more information.
Alrighty.
You know, based on that there are tools out there which can create brilliant documentations in PDF
format or whatever, and the content of that documentation will be based on the summaries that you have
created for your code.
Again, don't get me wrong, you do not want to add summaries for everything that you create in your
code, but if you develop a framework or a library or just some really intensive business logic of what
specific to your applications use case and might get used from other developers to, for example, do
yourself a favor, add a summary, or do them a favor, right, and add a summary for them.
Alrighty, so this is how you can create some more detailed documentation using the summary.