WEBVTT

00:00.000 --> 00:05.520
Okay, we've made it to the end of section two, and we'll just wrap up with a fairly quick summary

00:05.520 --> 00:09.990
and just recap on what we've done so far in this training course.

00:09.990 --> 00:15.120
We've taken a look at Net and what it is, and bear in mind we're only really scratching the surface

00:15.120 --> 00:15.360
of the.

00:15.540 --> 00:18.690
Net framework because it's big.

00:18.690 --> 00:25.470
It's an all encompassing develop anything kind of framework, and we're just focusing on the rest API

00:25.500 --> 00:28.350
side of things for what we're using it for.

00:28.380 --> 00:29.700
We created our project with the.

00:29.850 --> 00:30.510
Net CLI.

00:30.540 --> 00:31.950
We then looked at our project.

00:31.980 --> 00:36.810
We took a look at Entity Framework and using SQLite for our database functionality.

00:36.810 --> 00:39.150
And then we saved our hard work into git.

00:39.150 --> 00:40.590
And what did we achieve?

00:40.590 --> 00:47.340
Well, we're able to query our database for data and return it via our API controller.

00:47.340 --> 00:54.120
So we can now receive HTTP requests, and we can return HTTP responses that contains the data that we

00:54.120 --> 00:56.220
can retrieve from our database.

00:56.580 --> 01:01.620
So it doesn't feel like we've done or accomplished too much, but we have to start somewhere.

01:01.730 --> 01:03.980
So just some frequently asked questions.

01:03.980 --> 01:09.740
And often in the Q&amp;A, I see questions such as Lee's.

01:09.740 --> 01:14.690
So I'm going to try and cover them all in one go here because I do see them quite frequently.

01:14.690 --> 01:16.070
Why did I use SQLite?

01:16.070 --> 01:17.420
I did try and explain this.

01:17.450 --> 01:23.480
It's just a convenient database that we can use that doesn't require us to install a database server

01:23.480 --> 01:25.790
onto our operating systems.

01:25.820 --> 01:29.990
Our database is just stored in a file, and it's just a very quick and easy way to get up and running

01:29.990 --> 01:31.010
with a database.

01:31.010 --> 01:32.540
And it's great for development.

01:32.540 --> 01:35.000
It's not great for development in all circumstances.

01:35.000 --> 01:40.670
You might be reliant on specific functionality that SQL server or PostgreSQL gives you.

01:40.700 --> 01:45.710
In that case, you would just use SQL Server or Postgres for development as well.

01:45.740 --> 01:50.450
I know in our circumstance, in this case, SQLite is going to work fine for us.

01:50.450 --> 01:51.950
So that's the reason for that.

01:51.950 --> 01:54.770
But we will not be using it in production I promise.

01:54.770 --> 01:57.560
Sometimes I get asked why did I use the.net cli?

01:57.590 --> 02:00.500
Why didn't I create the projects using Visual Studio?

02:00.530 --> 02:05.540
Well, I can't use Visual Studio when I'm on a mac, for starters, because that's a windows specific

02:05.570 --> 02:09.770
application, and I'm talking about the full version of Visual Studio here.

02:09.800 --> 02:11.270
Visual studio 2022.

02:11.300 --> 02:17.150
That comes with a graphical user interface where you can right click Create New Project, and you can

02:17.150 --> 02:19.160
pick a web API type of project.

02:19.160 --> 02:24.800
And Visual Studio can set things up for you, but a dotnet CLI, I'd still recommend using it because

02:24.800 --> 02:30.980
it does give us a very quick, fast way of creating projects using templates that Microsoft provide,

02:30.980 --> 02:34.220
and it's consistent across Mac, Windows and Linux.

02:34.220 --> 02:35.690
So that's the reason for that.

02:35.720 --> 02:37.220
Why did I use VS code?

02:37.220 --> 02:43.520
Well, it's a popularity contest and it is the most popular code editor or IDE.

02:43.910 --> 02:49.370
Around 70% plus of developers use VS code every day for development tasks.

02:49.370 --> 02:55.280
And it's the same experience on windows, Linux, and Mac, and it's free to use and it's an obvious

02:55.280 --> 02:57.710
choice to demonstrate on a training course.

02:57.710 --> 03:02.210
I would highly recommend, though, giving the JetBrains products a go because they're now free to use

03:02.210 --> 03:04.360
and they are excellent.

03:04.360 --> 03:09.760
So if you did find small frustrations with VS code, then please do give those a go.

03:09.790 --> 03:12.160
You can write the code in those on this training course.

03:12.160 --> 03:13.840
No problem at all.

03:13.840 --> 03:15.520
And why would I use F?

03:15.550 --> 03:18.130
Why didn't I use another object relational mapper?

03:18.160 --> 03:21.250
Well, I'm purely sticking with the same technology stack here.

03:21.250 --> 03:21.490
Really.

03:21.520 --> 03:22.330
Microsoft make.

03:22.510 --> 03:24.730
Net and Microsoft make Entity framework.

03:24.760 --> 03:31.540
That's the reason and no other reason than that other object relational mappers could be used, of course,

03:31.540 --> 03:35.560
but I'm going for Entity Framework and there's no incorrect choice here.

03:35.560 --> 03:40.570
It's really just a preference in this case for this particular application.

03:40.600 --> 03:43.150
And why did I write the code this way rather than that way.

03:43.150 --> 03:48.070
And this can apply to any code that we write on this entire training course.

03:48.070 --> 03:50.950
And there is a saying that comes along in development.

03:50.950 --> 03:54.130
If it works, it's correct, which is kind of tongue in cheek.

03:54.130 --> 03:56.320
It's kind of right.

03:56.320 --> 04:00.190
But all of our code needs to adhere to certain principles.

04:00.190 --> 04:01.780
It needs to be maintainable.

04:01.780 --> 04:05.050
Is the code easy to read, understand and modify.

04:05.080 --> 04:06.880
That's what we're going for with code.

04:06.880 --> 04:12.910
And when you're thinking about why did I do it this way, then these are the principles in mind when

04:12.940 --> 04:14.830
writing the code in a certain way.

04:14.860 --> 04:16.330
Scalability comes into it.

04:16.360 --> 04:18.760
Does the code perform well as the system grows?

04:18.790 --> 04:20.320
Robustness as well.

04:20.350 --> 04:24.580
Can the code handle edge cases and unexpected inputs gracefully?

04:24.610 --> 04:25.690
Test coverage.

04:25.720 --> 04:29.650
Are there tests ensuring that future changes don't break existing functionality?

04:29.680 --> 04:30.580
Well there isn't.

04:30.580 --> 04:36.370
I'm not covering testing on this course, but when you are writing code, especially when you do come

04:36.370 --> 04:43.000
to the stage where you are writing tests, you'll find yourself writing code that makes it easy to test

04:43.030 --> 04:46.960
or use a different approach to writing the code with test driven development.

04:46.990 --> 04:51.820
Again, not something I'm covering on this course, but that, of course, encourages you to write code

04:51.820 --> 04:56.860
that's easy to test, as you're not going to write a convoluted test to start with.

04:56.920 --> 05:02.800
To write easier code, you'll write easy tests and then write code that suits those tests and of course,

05:02.830 --> 05:04.480
adherence to best practices.

05:04.510 --> 05:08.170
Does the code follow industry standard patterns and principles?

05:08.170 --> 05:11.440
So these are the goals that you're aiming for as you're writing the code.

05:11.440 --> 05:17.890
But there's always more than one way to achieve the same result even with applying to these principles.

05:17.890 --> 05:21.910
Another phrase that I quite like that does resonate with me make it work.

05:21.940 --> 05:26.230
Make it right, make it fast, which was coined by Martin Fowler.

05:26.230 --> 05:30.370
And this just emphasizes an iterative approach.

05:30.370 --> 05:35.320
First of all, we prioritize functionality, get the code to do what we want it to do.

05:35.650 --> 05:40.750
Once we know it does what we want it to do, then we can refactor for correctness and maintainability

05:40.780 --> 05:43.690
again, making sure that we don't break any functionality.

05:43.690 --> 05:48.970
And then finally, once you've done those two parts, finally optimize it for performance.

05:48.970 --> 05:51.040
And this is a good approach for beginners as well.

05:51.070 --> 05:53.920
Making it work is is the crucial factor.

05:53.920 --> 05:59.380
And then once you've got it working, if you've got a spaghetti code of mess, then obviously you can

05:59.380 --> 06:00.220
refactor it.

06:00.220 --> 06:02.650
Make sure what you're trying to do still works.

06:02.650 --> 06:07.450
So coming up next, we're going to take a look at the client side of our application.
