Tero, Jhon Orlan
Deep Concepts
of Programming
Agenda
Introduction 3
Implementing CRUD 4
User Interface Principles 13
Database Management 22
Application 27
3 Introduction
Yesterday, we have tackled about JAVA and
MySQL Connections, and how to connect our
JAVA applications into our database.
But today, were going to talk about deep concepts
of programming in developing our programs.
Implementing
CRUD
5 Implementing CRUD
CREATE
In Order to INSERT data on our database we need to use SQL Query
“INSERT INTO”
o Table – Where you want to place your data
o Columns – What rows you want to fill in information
o Values – The values of information based on keys
INSERT INTO [TABLE] ( col1, col2) VALUES ( val1, val2 )
INSERT INTO users ( username, password ) VALUES ( ‘you’, ‘me’)
6 Implementing CRUD
CREATE - Example
7 Implementing CRUD
READ
To read and select data in database, we need to consider these things
o Table – Your target table to read
o Columns – Your Selected Columns to return
o Where – Your logical conditioning that enables you to filter data you
need
SELECT [COLUMNS] FROM [TABLE] WHERE [CONDITIONS]
SELECT * FROM users WHERE user_type = 1 OR username = ‘johndoe’
8 Implementing CRUD
READ – Example
Since we need to
get the result of
our query, we
need to use
ResultSet
9 Implementing CRUD
UPDATE
To update data in our database we need all of these information
o Table – Your target table to read
o Set Values – The sets of columns and value to update
o Where – Your logical conditioning that enables you to filter data you need
UPDATE [TABLE] SET [VALUES] WHERE [CONDITION]
UPDATE users SET password = ‘abcd’ WHERE user_id = 1
10 Implementing CRUD
UPDATE - Example
11 Implementing CRUD
DELETE
To delete data in database, we need to consider these things
o Table – Your target table to read
o Where – Your logical conditioning that enables you to filter data you need
DELETE FROM [TABLE] WHERE [CONDITION]
DELETE FROM users WHERE user_id = 1
12 Implementing CRUD
DELETE - Example
User Interface
Principles
Learn how to design efficiently
14 Place Users at the Center
As always, the first UI design
principle is to focus on people
(or, the “user” as we all say).
A good user interface is easy
and natural to use, avoids
confusing the user, and does
what the user needs.
15 Minimize Actions and Steps Per Screen
Each screen should have one
primary focus.
16 Be Consistent
Consistency creates familiarity, and familiar
interfaces are naturally more usable.
Consistent design reduces friction for the user. A
consistent design is predictable.
17 Provide Useful Feedback
Feedback can be visual, audio (the ding of
a new message alert), or sense of touch.
Every action should have feedback to
indicate that the action was successful or
not.
Feedback helps to answer questions in four areas:
1. Location: You are here.
2. Status: What’s going on? Is it still going on?
3. Future status: What’s next?
4. Outcomes & Results: Yey, Success?
18 Provide a Clear Next Step
Include a clear next step a user can take
after an interaction.
That could be as simple as a “back to top”
click at the end of a long blog post or a
pointer to more information.
Help the user achieve their goals with the
next step.
19 Use Proper and Readable Fonts
Use of proper fonts, helps the user to
interact with your systems.
Make sure that your fonts is readable and
consistent.
These are the most common fonts to use.
1. Helvetica
2. Futura
3. Garamond
4. Times
5. Arial
6. Verdana
20 Proper use of Spaces
Space helps designers create visual
breathing room for the eye, and makes
users want to stay on the page.
It can also help to suggest function and
create emphasis of important content.
VS
The use of margin and paddings are
crucial in creating GUI.
21 Use representative color palette
The use of colors are very necessary and
important, since it represents the
company, group, business in your system.
Consistent use of colors allows user to
familiar in your content, and navigate
easily.
Commonly color palettes are ranging into 1 – 5 colors
22
DATABASE
MANAGEMENT
23 Use proper names
In creating databases, tables, and columns proper name
should be applied and it relates to specific functionality of
your needs
If there is white space replace it by underscore (_) or
capitalized the first letter of the next word
User id -> user_id / userId / userID
Email Address -> email_address / emailAddress
24 Use proper column type
In creating columns on tables, type should matched on
what the column are.
Firstname – Varchar
Age – Int
Price – Float or Double
BirthDate – Date
IsAdmin – Boolean
EntryDate - Timestamp
25 Always put primary key
Every table in databases should have 1 primary key, it
should be AUTO INCREMENTED.
This allows the table to be edited, allows deletion of data.
26 Set column default values
Creating columns that are optional ( not always filled by
the user ) must have a default value either NULL or
customized value.
It prevent having an error into SQL Query
Application
Are you ready for a demo?