Take the 2-minute tour ×

I'm designing a carpool system (drivers can publish their routes and passengers can subscribe to them) with WebServices(axis2) and Android clients (ksoap2).

I have been having problems with the logical architecture of the system and I wondered if this architecture is fine.

enter image description here

And another question: for that architecture (if it is ok), how would be the packages structure?

I suppose something like that:

(In android)
package org.carpool.presentation
*All the activities here (and maybe mvc pattern)

(In the server)
package org.carpool.services
*Public interfaces (for example: register(User user), publishRoute(Route route) )

package org.carpool.domain
*Pojos (for example: User.java, Route.java, etc)

package org.carpool.persistence
*Dao Interface and implementation (jdbc or hibernate)

share|improve this question

migrated from stackoverflow.com Nov 25 '11 at 5:16

This question came from our site for professional and enthusiast programmers.

Why is there 2 database systems, why they are not the same, are they both used for I/O? Do they need to be kept in Sync? –  Emmad Kareem Nov 25 '11 at 6:03
@enrmarc Looks as if your presentation layer is an Android app. Lacking any further details this architecture appears like a good starting point. The package names look reasonable, too. –  Manfred Nov 25 '11 at 6:07
@Emmad - I expect that since this is an Android app and you can't guarantee to always have a connection to the web service, the local database is used to store cached route & passenger info while off-line. –  Mark Booth Nov 25 '11 at 11:10
Thanks. Yes @EmmadKareem the databases need to be kept in Sync. –  enrmarc Nov 25 '11 at 15:51
@Mark Booth, thanks for the clarification. –  Emmad Kareem Nov 25 '11 at 15:52
add comment

3 Answers

up vote 1 down vote accepted

Yes, IMO that architecture is awesome, and I would recommend it (not that that means much, lol). It has worked for me in the past and present ... Although my experience was on the .net side of things (MVC / WCF / POCO / ENTITY|MSSQL) .. but form an architecture level, the layering is nearly identical.

great idea.. good luck

share|improve this answer
add comment

Overall, looks good. But I would give some thought to how you are gonna scale this if it's going to be a public system. If you expect very little changes to some of your data (route info) but expect it to be read a lot, you will need a memcached kind of caching solution at the backend. You should also think about write scaling, if you expect a lot of input.

Finally, You should capture your thoughts around your external dependencies for this(google maps? Facebook?). At this level, those assumptions will play a big role in understanding your product placement.

share|improve this answer
add comment

A carpool business is based on a good backend story. A few challenges that can surface are

  1. A carpool backend system is the efficiency of the search. If the search is quick and efficient, the entire system proves to be useful. As the database grows the search can only become worse. The question is how do you keep your search efficient as your database grows.
  2. What business model do you follow, is they key. If you are catering to a cab system, and not a carpool system then what will be the impact of this change on your design ? Will you need to change your entire backend too ? Very costly affair.
  3. Competition, there is so much out there, but frankly not enough :). the carpool websites out there are left to grow under "God's grace". Website owners develop the website like a blog and "hope" people will just walk in.
  4. Every website is offering a different solution, but just not able to meet up due to above challenges. That said, there is value in this business since there is so much opportunity.

We thought of this a few years back and developed a core engine that will enable businesses to just use our framework and build their car pooling website, mobile app. You only need to worry about your upper business layers. Think about it, instead of starting ground up, integrate our framework and use api calls like AddUser, AddVehicle, AddCarProvider, SearchCarProvider.

share|improve this answer
add comment

Your Answer


