📺 Develpreneur YouTube Episode

Video + transcript

How Do I Design Software?

2023-07-14 •Youtube

Detailed Notes

Software design is an art more than a science. However, we can follow a process that helps us find the proper requirements and points us to the best solution. These simple steps help us become a better developer.

You can find out more through our online classes at https://school.develpreneur.com and register for free. Registration will add you to our email list and you will periodically receive coupons for courses as well as notifications of the latest releases.

Transcript Text
foreign
[Music]
well hello we are going to essentially
start a project but talk about uh really
in this episode we're going to focus on
the question how do I design software
what's a good approach to designing
software and like most things I think
the best way to think through this is to
walk through the steps a little bit and
give us some experience in designing an
application
and so now this one while we're gonna
go in a little bit different directions
as we go through this this essentially
series of
of videos of tutorials of instruction
we're going to build something that
we're going to call the URL shortener
now I need to be able to type there and
we're going to do this in Python and so
I'm starting out in pie charm which
we can start with if you want you can go
answer the question how do I download
pycharm and it's free we're gonna
there's a Community Edition so you don't
have to worry about paying anything
signing up for anything anything like
that
and then once we get installed we're
going to come in here we're gonna do
file new project and here I'm just going
to give it a name so I'm going to call
it your url shortener
but I'm not a big fan of having a name
of a project that's just
blah like that so this is going to be
the URL shortener let's call him
uh let's just call them shorty we're
going to call this project shorty so
we're going to give it a name which is
usually a good thing to do now for these
I'm just using sweet python 3.9 I'm just
taking the defaults we may come back
later and change this but right now I
just want to get a project started
because what I'm going to do and it's
going to create my little virtual
environment
is I am going to actually sort of build
our documentation as we go
so this gives me a sample python script
so if I wanted to jump into terminal I
could come in right here mine is
actually called python3 so if I do
Python 3 main
bam hi pie charm so this is what this is
we'll get into that a little bit later
but what I do want is I'm going to take
this
and I am going to start
by
now let's see I'm trying to say if I
want to do this right now let's start by
right now let's just do a we're going to
create a document so we're going to do
here we're going to create a folder
uh we will call it a directory sorry
directory and this is going to be called
documentation
and then in here
I have a new file and this is going to
be the uh we'll say the
application design
and we're going to call it
uh we'll just we'll do this we'll make
it mark down
we're not really going to use the
markdown stuff too much but we're going
to use that so MD so let's just start
thinking about our design so first
the let's say the goal first we're going
to have a goal and so shorty
is a URL shortener
it it's going to take it takes a
a URL
it provides a shorter
link for the user to use okay easy
enough
so let's say we're going to have some
requirements here
so that's our goal
we have our requirements
and here let's just do it this way we're
going to do one is we're going to be
able to so
we're gonna a little bit design but a
little bit talk about requirements so
we're going to be able to take in a URL
provide a shorter one
let's see short URL
will be a uh let's see an address
or server name because this is things
like you know bitly or things like that
address or server name
and a parameter
so
let's say for example let's do an
example here
do an example
I'm going to send it https
developreneur.com switch
article slash
my really long article
title I don't even do it like this
because I think it usually does it like
that
is sent in
in let's call it https going backslash
uh
short not SRV that's necessarily what
it's going to be called I was going to
call one two three four five six
it's returned
and then uh
let's go here
and then using the returned
URL will send the user to the original
so
we need to
to store the original
and the short link
Maybe
and something we might want to do is
Let's see we may want to have some sort
of allow for branding
we'll come back to this later
because it may be that they just want it
to be something like it could be a
server name or a IP address so it could
be HTTP it could be as simple as HTTP
because we can do it without secure
because we really don't care so it could
be like uh 25 at
26.27.29 I don't know if that's a server
so please don't assume that but it could
be it could even be on a Forks it could
be we'll make it a port we'll do that
and it would be one two three four five
six so it could be that that is our link
maybe not but that's you know that could
be it or it could be
you know brand dot me something like
that so we may allow that
do we want to allow for multiple users
let's do we're going to have some sort
of user user
registration
let's make that a question mark because
we need to think about that a little bit
because the idea here is okay you give
me a URL and I'm going to give you back
a shorter one and then when you hit that
shorter one it's going to hit my server
or some server preferably I'm assuming
it's going to hit my server pass it that
and then that thing essentially just
going to do a redirect
so it's basically the steps are
first
is send a URL
new URL
is returned
call new URL
and then
redirect to
we'll call it the source URL so it's a
pretty simple application when you think
about it even though it has a lot of
power because it's often that you would
want to take some really long nasty
thing like this and this could be very
complex because it could even have like
a parameter
um you can have a series of parameters
whatever it is it doesn't matter what it
is
we're going to want to give a short one
and just for this it is let's see
let's just note
um
whoops where'd that goes six
there
let's sit this way okay and then what I
want is uh each well
okay so we don't need the actual URL to
be the source URL to be unique so we'll
allow that so if you three people send
the same URL you could get three
different short links but the short
links
must be unique
because you have to know which URL
you're going to go back to
now we could potentially let's say this
would be a question is do we want to log
traffic
or other info because we may
at some point want to do something with
that link
and that will
prompt the idea of a dfv value for value
it's a question that we will answer
actually all of these are going to be
questions we're going to end up
answering
um
so we have we get a URL so now this is
and this is sort of that process of
design isn't it all right what's our
problem
basically my problem let's say problem
definition
I have a long URL and need to provide a
shorter
one
basically for things like business cards
and stuff like that so that is my
problem definition so my goal is going
to be we're going to have this
application shorty it's going to be a
URL shortener we're going to take that
long URL and we're going to provide a
shorter link for the user to use
and basically here's requirements this
is roughly how it works let's move
let's move up
because
let's say input
and then just note let's see
result
so that's pretty simple
so now
we need to think a few things is so
we're gonna have some questions how do
we
allow a user to send us a URL
and give them
a short one
and then from that and the the rough
thing with that is going to be
and that's going to be sort of wrapped
up into that which is going to be let's
see Part B
sort of spoiler alert on the answer is
how do I create a
an API
using python
and then we're going to use a thing
called flask so this is going to be
how do I
create
an API and using flask
and we're going to do how do I
test an API call
and what this is going to be
where do I download
Postman because we're going to use
Postman for this
within this is
how do I create whoops
oops how do I
whoop
create a
database and table in
my SQL
Marie Marie DB
with python
because we're going to do this very
specifically we're going to script this
thing out
how do I have
so we've got our testing so we're going
to be able to create this
oh
how do I search a
table for a record
and this is going to be within a
relational rdbms our relational database
oops management system already BMS
and
then probably it's going to be how do I
API from
let's say an application
the uh JavaScript
and let's also say or python because
that's actually the whole goal of this
is I've got an application I want to do
this from python so I'm going to do it
from there
so that gives us a pretty good list of
getting started
so we're going to talk about
creating an uh API using python which
I think it's probably going to be in
here these will be sort of combined then
we're going to talk about testing an API
call which is going to be downloading
Postman so that's sort of our part two
how to create a database and how do I
search those are going to be together
and then probably within here is
how do I write a
an API endpoint
in flask
and
where would I use post
get
delete
types we're going to call that
request types
and we'll talk a little bit about that
so that's going to be probably together
as well
so that's what's coming up this should
be a pretty quick a little application
but now we have several things here
we've got several things that we have
walked through we've sort of said hey
what is all of this
let's move
branding and user registration let's
move those back here and now that's
totally offs out of number I don't know
there we go five six seven eight
um
and so that allows so I'm going to say
what is value for value
how
do I brand
my
um
how do I let's see how do I allow
for user branding of data
and then
use your registration
so I have to think about this is how do
I
create
a user
let's see
an application that requires
these are registration
and this will be a bigger challenge we
get to this
this one's probably pretty easy uh
actually that one's gonna be difficulty
so basically these are going to require
us to build an application so this would
be uh how do I build
a
web application
with python because we're going to use
it all we're going to be doing python
throughout this although it should be
pretty straightforward you could also
roughly do this in just about anything
else out there C sharp Java you name it
a lot of things have this option
different ways to skin this cap but we
are going to do it with flask
because that's a pretty cool little tool
so let's go ahead and we'll sort of wrap
this one up so now we this is how you
design as you sort of walk through and
say hey what is my problem what is the
problem I'm solving okay what is sort of
the goal what is the solution I'm
thinking about
maybe give yourself a couple examples to
work with and then start walking through
it it's like how do I get from point A
to point B how do I get from my problem
to my solution essentially and that's
what we've done here and now we're going
to dive a little bit further as we go
and actually walk into this so if you
come around the next episode most likely
you're going to want to look at is how
do we allow users send this URL and give
them a short one which is
basically how do I create an API using
python how to create an S and actually
this one I'm going to split this one up
uh uh because
we're going to do this most simply is
we're going to actually do this code
first do something very simple and then
we are going to turn around and add to
that so actually we're going to do this
so now see so that design thing is what
I'm going to do is first without doing
the API
I am going to actually we're going to
actually start building this thing out
in our scripts right away so
stay tuned very soon we will be coming
back or just click right ahead to the
next episode and we're going to talk
about how do we create something in
Python that allows the user to give us a
URL and we're going to give them back a
short one
thanks for listening
thank you
Transcript Segments
0.42

foreign

18.89

[Music]

27.359

well hello we are going to essentially

31.32

start a project but talk about uh really

34.5

in this episode we're going to focus on

36.239

the question how do I design software

38.76

what's a good approach to designing

41.1

software and like most things I think

43.739

the best way to think through this is to

46.62

walk through the steps a little bit and

48.239

give us some experience in designing an

51.42

application

52.559

and so now this one while we're gonna

55.5

go in a little bit different directions

56.879

as we go through this this essentially

59.1

series of

60.78

of videos of tutorials of instruction

63.32

we're going to build something that

65.519

we're going to call the URL shortener

68.76

now I need to be able to type there and

71.1

we're going to do this in Python and so

73.26

I'm starting out in pie charm which

76.799

we can start with if you want you can go

79.979

answer the question how do I download

81.42

pycharm and it's free we're gonna

83.88

there's a Community Edition so you don't

85.86

have to worry about paying anything

86.82

signing up for anything anything like

89.52

that

90.659

and then once we get installed we're

93.119

going to come in here we're gonna do

94.08

file new project and here I'm just going

97.14

to give it a name so I'm going to call

98.7

it your url shortener

102.78

but I'm not a big fan of having a name

106.079

of a project that's just

107.82

blah like that so this is going to be

111.54

the URL shortener let's call him

115.74

uh let's just call them shorty we're

118.5

going to call this project shorty so

120.06

we're going to give it a name which is

121.68

usually a good thing to do now for these

123.899

I'm just using sweet python 3.9 I'm just

126.6

taking the defaults we may come back

128.759

later and change this but right now I

131.039

just want to get a project started

132.42

because what I'm going to do and it's

135

going to create my little virtual

136.02

environment

137.16

is I am going to actually sort of build

140.16

our documentation as we go

143.58

so this gives me a sample python script

145.98

so if I wanted to jump into terminal I

149.76

could come in right here mine is

151.739

actually called python3 so if I do

154.08

Python 3 main

156.3

bam hi pie charm so this is what this is

159.3

we'll get into that a little bit later

160.86

but what I do want is I'm going to take

163.739

this

165.3

and I am going to start

168.08

by

169.64

now let's see I'm trying to say if I

172.019

want to do this right now let's start by

173.76

right now let's just do a we're going to

175.8

create a document so we're going to do

177.959

here we're going to create a folder

181.8

uh we will call it a directory sorry

184.379

directory and this is going to be called

185.94

documentation

189.78

and then in here

192.18

I have a new file and this is going to

194.819

be the uh we'll say the

198.379

application design

201.18

and we're going to call it

204.8

uh we'll just we'll do this we'll make

208.379

it mark down

210.78

we're not really going to use the

212.04

markdown stuff too much but we're going

213.959

to use that so MD so let's just start

216.42

thinking about our design so first

219.84

the let's say the goal first we're going

222.599

to have a goal and so shorty

225.959

is a URL shortener

231.06

it it's going to take it takes a

235.5

a URL

237.599

it provides a shorter

240.659

link for the user to use okay easy

244.799

enough

246

so let's say we're going to have some

248.28

requirements here

251.28

so that's our goal

253.019

we have our requirements

254.76

and here let's just do it this way we're

256.859

going to do one is we're going to be

259.919

able to so

261.959

we're gonna a little bit design but a

264.419

little bit talk about requirements so

265.44

we're going to be able to take in a URL

270.78

provide a shorter one

274.38

let's see short URL

277.62

will be a uh let's see an address

284.639

or server name because this is things

286.5

like you know bitly or things like that

290.34

address or server name

294.06

and a parameter

297

so

298.979

let's say for example let's do an

301.08

example here

303.18

do an example

304.919

I'm going to send it https

309.56

developreneur.com switch

312.259

article slash

314.639

my really long article

323.88

title I don't even do it like this

326.039

because I think it usually does it like

328.02

that

335.22

is sent in

340.02

in let's call it https going backslash

343.56

uh

346.74

short not SRV that's necessarily what

348.96

it's going to be called I was going to

350.52

call one two three four five six

352.32

it's returned

357.36

and then uh

362.46

let's go here

365.639

and then using the returned

369.84

URL will send the user to the original

376.08

so

378.18

we need to

381.66

to store the original

385.44

and the short link

390.06

Maybe

393.18

and something we might want to do is

395.16

Let's see we may want to have some sort

397.139

of allow for branding

399.36

we'll come back to this later

403.8

because it may be that they just want it

405.539

to be something like it could be a

408.3

server name or a IP address so it could

410.639

be HTTP it could be as simple as HTTP

412.979

because we can do it without secure

414.9

because we really don't care so it could

417

be like uh 25 at

420.199

26.27.29 I don't know if that's a server

422.22

so please don't assume that but it could

424.68

be it could even be on a Forks it could

426.24

be we'll make it a port we'll do that

428.94

and it would be one two three four five

431.4

six so it could be that that is our link

434.22

maybe not but that's you know that could

436.199

be it or it could be

439.16

you know brand dot me something like

442.38

that so we may allow that

445.979

do we want to allow for multiple users

449.34

let's do we're going to have some sort

451.44

of user user

453.3

registration

459.12

let's make that a question mark because

460.74

we need to think about that a little bit

461.699

because the idea here is okay you give

465.06

me a URL and I'm going to give you back

468.06

a shorter one and then when you hit that

470.94

shorter one it's going to hit my server

472.86

or some server preferably I'm assuming

476.46

it's going to hit my server pass it that

478.68

and then that thing essentially just

480.599

going to do a redirect

482.639

so it's basically the steps are

491.039

first

492.44

is send a URL

498.84

new URL

500.639

is returned

507.18

call new URL

512.459

and then

514.32

redirect to

517.8

we'll call it the source URL so it's a

521.039

pretty simple application when you think

522.839

about it even though it has a lot of

524.459

power because it's often that you would

526.92

want to take some really long nasty

529.2

thing like this and this could be very

532.5

complex because it could even have like

535.14

a parameter

537.54

um you can have a series of parameters

539.76

whatever it is it doesn't matter what it

541.32

is

542.04

we're going to want to give a short one

544.2

and just for this it is let's see

550.019

let's just note

552.18

um

554.1

whoops where'd that goes six

557.279

there

558.6

let's sit this way okay and then what I

561

want is uh each well

565.44

okay so we don't need the actual URL to

568.26

be the source URL to be unique so we'll

570.959

allow that so if you three people send

573.3

the same URL you could get three

575.1

different short links but the short

577.26

links

579.959

must be unique

581.58

because you have to know which URL

583.32

you're going to go back to

585.54

now we could potentially let's say this

589.86

would be a question is do we want to log

593.7

traffic

596.7

or other info because we may

600.779

at some point want to do something with

603.66

that link

604.86

and that will

607.8

prompt the idea of a dfv value for value

614.58

it's a question that we will answer

616.08

actually all of these are going to be

617.22

questions we're going to end up

618.12

answering

621.66

um

622.56

so we have we get a URL so now this is

626.04

and this is sort of that process of

627.54

design isn't it all right what's our

629.04

problem

629.88

basically my problem let's say problem

631.92

definition

635.88

I have a long URL and need to provide a

642

shorter

643.32

one

644.7

basically for things like business cards

646.8

and stuff like that so that is my

649.14

problem definition so my goal is going

651.36

to be we're going to have this

652.079

application shorty it's going to be a

653.579

URL shortener we're going to take that

655.44

long URL and we're going to provide a

657

shorter link for the user to use

659.459

and basically here's requirements this

661.56

is roughly how it works let's move

663.839

let's move up

666.66

because

670.2

let's say input

678.839

and then just note let's see

681.839

result

683.16

so that's pretty simple

687

so now

688.62

we need to think a few things is so

690.48

we're gonna have some questions how do

691.98

we

694.26

allow a user to send us a URL

701.04

and give them

703.8

a short one

707.7

and then from that and the the rough

709.98

thing with that is going to be

712.2

and that's going to be sort of wrapped

713.76

up into that which is going to be let's

715.92

see Part B

718.079

sort of spoiler alert on the answer is

721.079

how do I create a

725.16

an API

727.079

using python

729.6

and then we're going to use a thing

731.279

called flask so this is going to be

734.04

how do I

737.76

create

739.98

an API and using flask

745.56

and we're going to do how do I

748.44

test an API call

760.68

and what this is going to be

763.94

where do I download

767.54

Postman because we're going to use

769.62

Postman for this

772.019

within this is

773.88

how do I create whoops

777.66

oops how do I

781.56

whoop

783.12

create a

785.459

database and table in

789.24

my SQL

792.36

Marie Marie DB

797.399

with python

799.5

because we're going to do this very

800.88

specifically we're going to script this

802.079

thing out

805.86

how do I have

808.8

so we've got our testing so we're going

810.42

to be able to create this

815.22

oh

818.88

how do I search a

822.24

table for a record

826.68

and this is going to be within a

829.079

relational rdbms our relational database

833.88

oops management system already BMS

839.48

and

841.38

then probably it's going to be how do I

846.779

API from

850.2

let's say an application

857.639

the uh JavaScript

863.24

and let's also say or python because

867.36

that's actually the whole goal of this

869.1

is I've got an application I want to do

871.2

this from python so I'm going to do it

872.76

from there

875.279

so that gives us a pretty good list of

878.22

getting started

881.399

so we're going to talk about

883.44

creating an uh API using python which

888.06

I think it's probably going to be in

889.5

here these will be sort of combined then

891.66

we're going to talk about testing an API

893.279

call which is going to be downloading

895.26

Postman so that's sort of our part two

897.24

how to create a database and how do I

899.88

search those are going to be together

902.339

and then probably within here is

907.32

how do I write a

911.899

an API endpoint

916.86

in flask

919.98

and

926

where would I use post

930.36

get

932.22

delete

936.06

types we're going to call that

938.779

request types

942.54

and we'll talk a little bit about that

943.86

so that's going to be probably together

946.079

as well

948.12

so that's what's coming up this should

949.44

be a pretty quick a little application

951.6

but now we have several things here

955.019

we've got several things that we have

957

walked through we've sort of said hey

958.199

what is all of this

959.899

let's move

962.399

branding and user registration let's

964.68

move those back here and now that's

967.139

totally offs out of number I don't know

972.6

there we go five six seven eight

975.24

um

978.06

and so that allows so I'm going to say

980.339

what is value for value

985.68

how

988.139

do I brand

993.66

my

997.56

um

998.399

how do I let's see how do I allow

1002.12

for user branding of data

1006.8

and then

1008.959

use your registration

1011.48

so I have to think about this is how do

1014.3

I

1016.399

create

1019.399

a user

1021.38

let's see

1022.94

an application that requires

1026.36

these are registration

1030.799

and this will be a bigger challenge we

1032.66

get to this

1034.52

this one's probably pretty easy uh

1037.04

actually that one's gonna be difficulty

1038.24

so basically these are going to require

1039.439

us to build an application so this would

1042.079

be uh how do I build

1044.839

a

1046.4

web application

1049.22

with python because we're going to use

1051.02

it all we're going to be doing python

1052.34

throughout this although it should be

1053.419

pretty straightforward you could also

1056.26

roughly do this in just about anything

1059.059

else out there C sharp Java you name it

1062.9

a lot of things have this option

1065.12

different ways to skin this cap but we

1067.46

are going to do it with flask

1070.58

because that's a pretty cool little tool

1073.7

so let's go ahead and we'll sort of wrap

1077.84

this one up so now we this is how you

1080.48

design as you sort of walk through and

1081.799

say hey what is my problem what is the

1084.98

problem I'm solving okay what is sort of

1087.44

the goal what is the solution I'm

1088.64

thinking about

1089.78

maybe give yourself a couple examples to

1091.7

work with and then start walking through

1093.32

it it's like how do I get from point A

1095.48

to point B how do I get from my problem

1097.24

to my solution essentially and that's

1100.76

what we've done here and now we're going

1102.799

to dive a little bit further as we go

1104.48

and actually walk into this so if you

1105.919

come around the next episode most likely

1108.86

you're going to want to look at is how

1111.44

do we allow users send this URL and give

1113.12

them a short one which is

1114.98

basically how do I create an API using

1118.039

python how to create an S and actually

1120.5

this one I'm going to split this one up

1123.2

uh uh because

1127.58

we're going to do this most simply is

1129.14

we're going to actually do this code

1130.22

first do something very simple and then

1134.6

we are going to turn around and add to

1137.84

that so actually we're going to do this

1139.22

so now see so that design thing is what

1141.799

I'm going to do is first without doing

1144.38

the API

1146.179

I am going to actually we're going to

1148.88

actually start building this thing out

1150.26

in our scripts right away so

1153.38

stay tuned very soon we will be coming

1155.78

back or just click right ahead to the

1157.7

next episode and we're going to talk

1159.44

about how do we create something in

1162.62

Python that allows the user to give us a

1164.299

URL and we're going to give them back a

1165.98

short one

1167.059

thanks for listening

1180.5

thank you