Welcome Guest, Not a member yet? Register   Sign In
Whats your approach to starting a new CI project?
#1

[eluser]Gram3000[/eluser]
When starting a new CI project, is there a recommended place to start?

Is it best to start with a model to define the heavy lifting of the programme or start with the controllers or views?

Are there any guides on recommended approaches to a new project?
#2

[eluser]renownedmedia[/eluser]
Theoretically, you should know exactly what you want your project to do before you start building it. If you've got that much covered, you can usually start with your models first, then move on to controllers and views.

I usually build a layout before all of that. I have developing a site in times new roman then applying a layout, but that's the designer in me talking.

I've been using the following template library:

http://maestric.com/doc/php/codeigniter_template

It's pretty simple to work with, and I'm sure that sooner or later it will no longer suffice for my projects. Personally I hate using header and footer files and recommended you use some sort of template library with your projects.
#3

[eluser]wowdezign[/eluser]
Like renownedmedia, I also begin with the layout because of my design background.

What I am going to present to the visitor has a bearing on what data I am going to need (Model) and how I will manage the logic (Controller) behind presenting the data (View).

After I get the layout template created, I can then see how better to work with the data.

That being said, if the site I am working on is driven by a database, I do that even before the layout.

I guess, for me, it really depends on what I am building.
#4

[eluser]davidbehler[/eluser]
1. Write down what features I need/the customer wants as detailed as possible
2. Create database with all its tables and so on
3. Create a baisc layout for the page, nothing fancy but more or less like the final layout (that in my case will be provided by designer as I kinda suck @ graphics Big Grin)
4. Start with one controller and its corresponding models/libraries/whatever, for me it's usually the one that deals with login, logout
5. and then create all the other ones as you go and progress

I usually finish one controller before I start a new one and I add functions to the model when I need them (apart from add, edit, get, delete as say are more or less the same in each model). If I got some really complex queries I might create and test them in phpmyadmin before actually putting them in a model to make sure they work and return the wanted result.
#5

[eluser]Gram3000[/eluser]
Thanks for the responses.

Starting with the database tables makes sense to me, its usually what I think about first in an app.

Then working on the views seems to be a good idea which leads to the controllers and models being made as functionality is being developed.

This is what I currently do when creating an app. I was wondering mainly are there guidelines or rules of thumb to consider when starting, like how many models will there be, their names, function names etc or do you let it grow organically?
#6

[eluser]naren_nag[/eluser]
Here's my method:

What I like to do, before writing even a SINGLE line of code, is design the software. And by design, I don't mean the User Interface. I start with a simple powerpoint/keynote file where I go over the software like I would with a user who will finally use it. I run this past a couple of people and get feedback, so that what I'm thinking and saying is well understood by the people who are going to use it. You could do this using post-it notes as well, but building a slideshow is a great way of organising your thoughts.

Then I start building a class diagram (read Object Oriented Analysis & Design by Grady Booch). Basically by defining my classes and the relationships between the classes, I try and create an underlying design that is robust, and allows me to grow the software when the time comes. And I always assume I won't know how I'll have to grow the software.

I then start to convert the class diagram into an Entity Relationship diagram. Here's where the fun starts and I start picking between 3rd normalized and 5th normalized schemas.

And then I go to the user interface and start building wireframes. These are simple (sometimes HTML) templates where I layout all the screens in the application. I define behaviour and document all the things I have to watch out for (eg. tagging will only work for logged in users ...)

Once all this is done, actually writing the app takes very little time. I start with the models: one for each table in the database (except for join tables). The naming convention I follow is: tables have names in plural, and models have the name in singular (eg. Table USERS, model User).

For the controllers and methods I try to follow REST principals, the controller is a noun and the method is a verb: document/add or document/edit

I also try and follow a naming convention for my variables. When I create an object of a class the classObject, so $userObject = new User();

In my forms, I give my form fields (for the most part) the same name as the table field they correspond to.

And that's about it.

Smile

cheers,

Naren
#7

[eluser]Gram3000[/eluser]
Hi Naren,

Thanks for a great and detailed reply. Its a structure just like this that I'd like to follow for my own developments.

I have no idea what a 3rd or 5th normalized schema of an entity relationship diagram is, but I'll find out Smile

I like the approach of 1 model per table and the naming scheme of the models and tables is just like CakePHP or RoR, I follow this already myself.

I too am finding that the more time I spend on the planning of the app, the less time I spend on actually coding the app.

Now to find the time to document all the projects Smile
#8

[eluser]naren_nag[/eluser]
[quote author="Gram3000" date="1249415005"]
I have no idea what a 3rd or 5th normalized schema of an entity relationship diagram is, but I'll find out Smile
[/quote]

Big Grin .. sorry about the total geek out in that sentence, just read it again myself :p

Also check out, DMZ -- it's an ORM library that I've been using extensively and it takes all the crud out of writing models ...http://overzealous.com/dmz/index.html

Quote:Now to find the time to document all the projects Smile

aaaaah yes, yes ... douglas adams had it right the first time around: keep a towel handy, and never panic Big Grin
#9

[eluser]GSV Sleeper Service[/eluser]
my workflow

1. move application and system out of the webroot
2. update the paths in index.php
3. install native session library to avoid IE headaches
4. install Doctrine
5. ???
6. cliched meme




Theme © iAndrew 2016 - Forum software by © MyBB