Welcome Guest, Not a member yet? Register   Sign In
Forum prototype - Constructive criticism requested.
#32

[eluser]TheFuzzy0ne[/eluser]
Yes, that really does help. Thanks a lot for your comments. I know I over-think things a lot, but it's nice to know that it's not just me who sees problems like this in seemingly simple decisions.

The only reason I wanted to create the forum to be CI specific (to start anyway), is simply because CodeIgniter is a great framework, and doesn't have a forum tailored to take advantage of that framework. Also, as this is for a client, I need to get it finished ASAP, and I think the only way to do that, is to depend on CodeIgniter being the backbone. Also, there are a lot of forums out there, and I don't want to contend with them just yet, I just want to provide my fellow CodeIgniters with a fairly decent, simple forum. I think you're right though, forums are generally written in a procedural style. I was thinking of going with a model along these lines, all one model:

Code:
class Forums_model extends Model
{
    function Forums_model() { parent::Model(); }
    
    function get_forum($id) {} # Returns the specified forum as a forum object.
    function add_forum($forum_object) {} # Adds a forum.
    function update_forum($forum_object) {} # Updates a forum.
    function delete_forum($id) {} # Deletes the specified forum.
    function get_child_forums($forum_id) {} # Returns an array containing any child forums.
    function get_child_threads($forum_id, $page_num) {} # Returns an array containing the child threads within the given page.
    
    function add_thread($forum_id, $user_id, $title) {} # Adds a new thread
    function delete_thread($thread_id) {} # Deletes a thread.
    function update_thread($thread_id, $forum_id, $title) {} # Updates a thread.
    function get_thread($thread_id, $page_num) {} # Returns an array of posts. Not sure if I actually need to implement this.
    
    function add_post($post_object) {} # Adds a post.
    function update_post($post_object) {} # Updates a post.
    function get_post($post_id) {} # Returns the post with the specified ID.
}

I think it's a little bit inconsistent, as there's no thread object, and probably needs a little tweaking, but by using objects, I'm hoping to be able to easily implement changes (adding extra fields), without ending up with functions that take lots of arguments, in a seemingly random order. At least with objects and associative arrays, it allows for expansion much more easily IMHO. Also, there are a lot more methods to be added, but I just want to stick to the basics for now.

As always, comments and criticism welcome.

Thanks again!


Messages In This Thread
Forum prototype - Constructive criticism requested. - by El Forum - 04-30-2009, 09:03 AM
Forum prototype - Constructive criticism requested. - by El Forum - 04-30-2009, 11:30 AM
Forum prototype - Constructive criticism requested. - by El Forum - 04-30-2009, 11:51 AM
Forum prototype - Constructive criticism requested. - by El Forum - 04-30-2009, 02:17 PM
Forum prototype - Constructive criticism requested. - by El Forum - 04-30-2009, 07:25 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 01:59 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 05:42 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 05:57 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 06:09 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 07:13 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 07:32 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 07:50 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 07:57 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:02 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:14 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:22 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:28 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:36 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:38 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:41 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:50 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 08:57 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 09:04 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 09:18 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 09:23 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 09:29 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 09:54 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-01-2009, 01:57 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-02-2009, 11:48 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-03-2009, 05:22 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-03-2009, 06:14 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-03-2009, 06:41 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-04-2009, 07:27 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 09:23 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 09:31 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 09:49 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 09:50 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 02:41 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-05-2009, 07:35 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-06-2009, 05:01 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-06-2009, 08:06 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-06-2009, 08:11 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 09:40 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 09:45 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 11:38 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 11:49 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 12:06 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 12:10 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-11-2009, 11:48 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 01:41 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 06:40 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 06:50 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 06:56 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 06:59 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 07:21 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 07:24 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 07:42 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 07:47 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 11:24 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 11:29 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 11:34 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 12:04 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 01:19 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 02:23 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 02:31 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 02:34 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-12-2009, 02:45 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-13-2009, 04:36 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-13-2009, 05:13 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-13-2009, 02:39 PM
Forum prototype - Constructive criticism requested. - by El Forum - 05-15-2009, 08:45 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-15-2009, 08:53 AM
Forum prototype - Constructive criticism requested. - by El Forum - 05-15-2009, 09:08 AM
Forum prototype - Constructive criticism requested. - by El Forum - 07-17-2011, 09:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB