DevNetwork - A website where users can solve programming challenges

moodusroundoSoftware and s/w Development

Aug 15, 2012 (5 years and 2 months ago)

256 views

DevNetwork

Team:

The team members of Project are:

-

Víctor Ferrer García

-

Manuel Caballero Sánchez

-

Daniel Cáceres

Maña

What is DevNetwork?

DevNetwork

is a website

where users can

solve

programming challenges

(and other

areas)

and
upload their own

challenges
for

other users

to resolve it
.
You

have

added elements of

social
networks

today,

as there is

the concept of

'friend'
,
which

can meet

his past actions

on your
homepage
.


Other features

that make

DevNetwork

a social network

are

you

able to

find

statistics

of

other
users
, send
and receive

private messages,

and discuss

both the challenges and

solutions.


As the creator of

a challenge
, you must
provide a password

that all users

should be

introduced

to upload

a solution
, you also

have to

validate the solutions
, a
nd in the
case

that

they are,

rate
them
.

Development

tools

For

the project

has been used as

specified

requirements,

the following languages:

-

PHP

-

XHTML 1.0

-

CSS

-

JavaScript

-

SQL

As tools

NetBeans

7.0.1

is

chosen

as the

integrated development environment
,

for
servers

(Apache

and

MySQL
)

we

used

XAMPP

1.7
.
4,

and to administer

the database
,

MySQL
Workbench

5.2.

Finally to

the teamwork

we have chosen

Google Code,

as

Subversion server.

Data Base

For the database, as mentioned above was used MySQL also has been used
for UTF
-
8
character encoding.

The following diagram reflects the database is designed for the website.


As we see in the diagram, the database is in 3NF, although we will prove:

The definition of 3NF requires compliance with the 2NF and 1NF this time
assume, so we'll
start by showing that the complete database of 1NF:

1NF:

Definition: For a database is 1NF, each column must be atomic.

This definition is easy to verify since no column of the database will contain lists or other non
-
atomic.


2NF:

Definition: For a database to be in 2NF first must be 1NF, plus all the columns that are part of a
key candidate must provide complete information about the key.


To meet this definition, we can see in the database have been used for primary key

the

column

'Id'. And the example of table 'friends' attributes provides information only on the
relationship of the
primary
key {'IdUser1', 'IdUser2'}.


3NF:

Definition: A database is

in 3NF if it is in 2NF and there are no transitive dependencies
.

To fulfill this
normal form is essentially not be able to get the same data in two different ways,
for example, if we eliminated the table 'challenge_categories' and their
attributes are found in
table 'c
hallenge
s
', this property is not fulfilled because the column 'Descr
iption' would have a
transitive dependency with respect to 'Id' of 'challen
ge' through the column 'Name'.

Server Code

For the server code, we use PHP, we have designed a structure to access the database, to
simplify the quer
y execution and improve safety.


On one side
it has used the pattern 'Si
n
gleto
n' to concentrate all calls to the database on a
single object, reducing the creation of connections. You have created a wrapper class 'PDO'
running the queries on the database to facilitate query construction
and control of errors with
the database.



On the other hand we have the set of classes that model the database and their
corresponding repositories for common tasks
.



Views, Client Code

and Styles

For the generation of HTML pages you have created a
template system. For this we have
implemented a class called 'Template'.


By

constructor is passed the name of the template and this generates the layout file path,
after
,

the "initialize" contains custom code for each template, and initializes the PHP ou
tput
buffer with the call to 'ob_start ()' . Finally, the method 'createPage' rece
ive

the title of the
view,
and then the output buffer is
pick
ed

up
and

stores it

content in a variable. F
inally the
layout
is executed and the page is returned to the client
.

Another important aspect is the file 'initialize.php', which is included in all
PHP

files that
generate views.
It c
ontains among other things, the application path on the server, and
it

relative
URL
.

We have also implemented two classes with useful featur
es.

As
client

code Javascript has been used, together with libraries like jQuery

and some plugins
for this and making use of AJAX, we have implemented the validation, paging of the
comments, messages, etc. among other features. Of course, as specified in the requirements
of the projec
t there are some

part
s

of the implementation that d
oe
s not use any external
library.

Finally remark that the CSS version used is 3, though not in its final version has already
released the W3C validators.