RSS

iPhone development diary – Week 1

20 Jun

I’ve started the development of our new iPhone software. Because this is my first iPhone project I’m going to keep a diary of my progress.

This first post will outline how my first week went on the project.

The project

The iPhone app I will be creating will be an iPhone version of our companies survey application. The initial version will be just for Domestic Energy Assessors to create EPC reports. Later versions will include support for our other survey types.

The setup

Before starting any development I had to get my project and environment setup.  I’m developing the project using my iMac (27″)  and my MacBook Pro laptop.  I will also be using my PC for the backend services which the iPhone app will talk to upload the survey data and talk to our backend systems.

Development tools

Below is a list of the different tools i’m using.

  • Photoshop
  • XCode 4
  • Navicat for SQLite
  • Visual Studio 2010
  • Team Foundation Server

The first week…

My first week on the project wasn’t the most exciting week, I spent the majority of the week planning the project and getting my XCode project setup ready for the main work to begin.  To manage the progress of the project i’m using Team Foundation Server, so my first task was to get a list of all the features and create my User Stories in TFS.  Once I had all my user stories written I then went through and assigned a rough estimate of the number of days required for each story.  I’ve broken the project down into 4 week sprints and will release a beta version for testing at the end of each 4 week sprint.

Using my user stories I picked out the ones that I needed for the first beta release, this first version would provide the ability for users to create an account and complete a survey by working through sections of questions.  To get this first version out I need to create the following features of my app:

  • Base business object framework
    This base framework will be used by all my business objects and will be simple to start with providing a simple Dirty/IsNew tracking and an interface for the database access routines.  The framework will also have a custom collection which will handle checking the dirty flags of each child object and will manage the calls to each objects Insert/Update/Delete routines.
  • Survey Framework
    The survey framework will be the meat of the project and will handle the Question answer validation and the logic of the survey progression.  Each question in a survey will belong to a section and each question will contain validation logic which will determin what the next question in the flow will be.  There will be a couple of section types that will include a standard section type and a repeating section type.  The standard section type will hand a single flow of questions and a repeating section will enable multiples of the same question flow to be completed.  For example on the EPC survey there can be multiple building parts of an house, and each building part will need a set of questions answering.  So the repeating section will store a set of answers for each building part specified.
  • Account signup
    The account signup feature will be required to enable users to setup an account with etech which will then be used to submit the surveys to our backend services.  So I will need some registration screens and account management screens.
  • Survey management
    As well as the main survey framework I need to create some survey management screens which will enable the user to view a lsit of their surveys and be able to start new surveys.  So I will need a survey listing and search screen and also a new survey screen.  The new survey screen will need to communicate with the backend services to do address searching.
  • Backend webservices
    I need to also create a set of backend webservices which will enable the software to send various message types to the server and get responses back

Now I have my list of features for the first sprint set out I went into TFS and broke each feature down into smaller tasks.  TFS is great for managing a project and provides some nice reports for tracking the progress of the project.  I’ve setup my sprint start and end dates and now have a nice dashbaord showing how everything is going.  Each task an estimate in hours of how long it will take, and as I complete each task I input how many hours it actually took and mark the task complete.  This enables TFS to track how many hours i’m spending on tasks and can predict based on the progression if the sprint will be completed on time.  If the sprint looks like its going to run over I can then remove some features from the sprint and reduce the amount of work requried for the sprint.  The idea is to adjust the number of features in each sprint rather than adjust the sprint timelines.

So after the first couple of days I had my TFS project all setup and the tasks and dates all inputted.  Now my next task was to get the project in XCode setup and ready.  The first thing I did was create my folder structure for the project.  I created a structure similar to below:

  • Smart Survey
    • Resources
    • Accounts
    • Database
  • Smart Survey Library
  • External Frameworks
    • eBOF
    • ASIHTTP
    • EGODatabase
    • JSONKit

The smart survey folder will contain the main Interface elements and will be broken down into each feature set of the app.  e.g. the account management screens will be contained within the account folder.

The smart survey library will contain all my business objects, the business objects will be the model objects of the project.

The external frameworks is well external frameworks :)

Finally the project is setup, time to get some coding done…

The project setup took much longer than I thought, I spend a couple of days on the TFS setup and tasking up the project, then spent another couple of days setting up my project in XCode and choosing the external frameworks to use in my project.

The first coding task to tackle was the Business Object Framework.  When developing my apps for windows mobile, desktop and web I’ve been using a framework called CSLA which is great, it provides object state tracking such as IsDirt, IsValid, IsNew, IsDeleted and also provides an interface for the data access routines.  It also handles child objects, validation and authorization.

For my iPhone app I wanted it to be simple and provide a basic subset of CSLA, so I created BusinessBase and BusinessListBase classes which have some properties for IsDirty, IsNew and IsDeleted.  There are also some skeleton methods for the database access.  The base classes have a Save method which is already implemented.  The save method will check the internal state of any objects and will call the relevant database methods based on that state.  e.g. if the object is new it will call the DatabaseInsert routine and if its not new but is dirty it will call the DatabaseUpdate routine.  The BusinessListBase save routine is a little different, it will loop through an array of objects and call the save routine on each.  If the object is marked as deleted it will add it to a deleted array and then loop through the array and call the DatabaseDelete method on each object and remove it from the main array of objects.

There is a bit more to this business object framework, such as handling child objects and each property needs to be implemented in a way that when the value changes it will mark the object as dirty.  I will write up a blog post about the business object framework when I get some spare time, probably a weekend job.

I finally got my business object framework complete and create a couple of business objects to give it a test.  Everything seems to be working as expected.  I had originally estimated about 3 hours for this tasks, but it took me 6+ hours, so my initiall estimates are going to plan, they always say you should put down an estimate, and then double it for it to be realistic :) .

Anyway onto the next task now, the account setup feature.  For this I needed a database table to store the surveyor details and also a surveyor business object to handle the loading/saving of the surveyor details.  To create the database I used a tool called Navicat for SQLite which is excellent and free.  My first task for the account setup was “Create local database tables and Business object for Surveyor”, I estimated 2 hours for this and again it took double that, 4 hours later a finally finsihed.  I think the reason this task took twice as long was because its my first business object and I made a couple of tweaks to the business framework while creating the surveyor objects.  Hopefully future objects wont take as long now i’ve got past my first one.

First week over

That was it for my first week.  I’ve got my environment setup, my project setup, my project management setup and have made a start on the actual code.  Next week i’ll be starting on my first screens for the project, the account signup and login.  This part of the project will involve creating some screens, business objects and some server side services to create the account in our backend systems.  So I will be doing some Objective-C code and some .Net code next week.

Advertisement
 

About craigmellon

Software development manager for eTech Ltd. I started out developing with Visual Basic 3 and have used all versions of Visual Studio and now. Have recently developed a work management system using Silverlight, and an asset management system using WPF. Currently developing mobile survey solutions using .Net Compact Framework and currently learning IOS development to move our survey solution onto the iPhone/iPad.
Leave a comment

Posted by on June 20, 2011 in Development, iPhone

 

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.