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

[eluser]TheFuzzy0ne[/eluser]
Sorry, I didn't make it clear that I was going to go back to keeping all of the functions in a single model. I thought that was what we were discussing?

I decided to go with Google, using this query:

Quote:siteConfusedourceforge.net inurl:projects php forum -framework

I got 1650 results.

For me, clicking on the link you posted yields 15649 results. Strange...

Running this query on Google:

Quote:siteConfusedourceforge.net inurl:projects php forum oop -framework

yields 26 results, so I'll check those out. Thanks. Smile
#22

[eluser]Dam1an[/eluser]
Posting the URL for my query lost the quotes around PHP and forum... Oh well, you've got some to look at, so it doesn't matter anyway

And I assumed it would be a model/object? But if you want a single file, then go for it

(Earlier on, when I said all the database stuff would be in one place, I mean in one folder as oppose to one file, instead of throughout all your models etc
#23

[eluser]TheFuzzy0ne[/eluser]
I don't "want" a single file, I want to go whatever way the majority of programmers would go. Smile

Sadly, just about all of the results I've looked at so far are not MVC forums but rather frameworks, or there are no files available for download at the current time.

With all the hype about MVC and communication, should it really be this hard to find an MVC forum? I thought I'd be beating them away with a big stick, but apparently I was wrong...

EDIT: Aaaaah! (The penny dropped), so are you proposing that I have a model for forums and one for threads?
#24

[eluser]Dam1an[/eluser]
Yes thats exactly what I'm proposing
And have you looked at vanilla?
It appears to be OO (well it uses classes) but its also 26,000 line
#25

[eluser]TheFuzzy0ne[/eluser]
I'm still not 100% on how I should structure it. As I said, I want to go the route that the majority of developers would expect. Please could you give examples of the methods you might find in those models. Also, I'm not sure whether you're suggesting I pass back data in an array or as an object.

I'm going to look at vanilla now.

Thanks again.
#26

[eluser]Dam1an[/eluser]
I'll mock up the structure I would use for an MVC forum later on (I should really be working now)

As for passing back data, I'd probably use an array, there's no point creating an object to store a collection of objects (eg posts or threads) and once you've retreived them, you're not going to manipluate them, just process them so a sequential array would be fine.

As for doing it in whatever style most developers would want, I can see why you'd want to do that, but that would mean admitting that the current methodogies are the best we can do...
Many years ago, everyone would have expected software to be done procedurally, and it was, until someone thought there must be a better way...
MVC is a combination of pure MVC and OOP, so its best of both worlds
#27

[eluser]TheFuzzy0ne[/eluser]
Much appreciated. You're under absolutely no obligation to go through with it. I understand it's a big ask.

I see what you mean, but I don't think I'm explaining myself properly. What I'd like to achieve, is a simple forum API that isn't hard to learn, and isn't too strict, much like CodeIgniter is. I think the key to this is structure and meaningful method names. Once I have that in the bag, I think the rest is self-explanatory. It's just that I've redesigned my database back-end now twice, and each time I've thrown it out thinking "this is just getting too complex!".

Vanilla is awesome. It's not MVC, and it's a bit hard to understand, but I really like the concept, although they seem to use objects for just about everything. I like that approach, as you can edit each object accordingly to make it behave differently. I like this idea, as it helps add a layer of protection to your application, as well as extra functionality. For example, say I have an object for a post, I could have $post->get_content() and $post->get_db_safe_content() or something like that. So then we have two methods on the same object, capable of passing back the content in different formats.

I'm still really confused. We've discussed so much, but I can't even remember whether you suggested that the models pass back objects, or accept objects etc... For example, I think get_post should pass back a post object, as it might need to be edited or something, but then again, is there even any need when you can just pass the text to an update method in the model, and just insert it without even having to initialise the object from the database.

I think everything has it's pros and cons. I think what would make a difference is if I used objects for the posts, but didn't actually have a save() method, but rather the object can be passed to the model, and the model can ascertain whether or not there are any problems using methods in that object (is_valid()) for example(?). This should help prevent incorrectly formatted data being inserted into the database.

Argh! So many thoughts now, I just don't know... (This one of my more annoying traits). I'm going to go back to checking out Vanilla and chilling before my head explodes...
#28

[eluser]Dam1an[/eluser]
I now know what you mean when you said you keep changing your thoughts about the structure as soon as you finish with a structure... Except I find myself changing my mind before I even get half way through the structure :S

As for the get_post passing back an object, you thinking of a datamabe obect (like in CI) or creating an object, settings its args (or it being set by the constructor) and passing back the object? Both work in much the same way once you've received it, but will make a difference on the way you choose to implement it

One thing to consider (which you've kind of talked about) is in what situation will [otential users integrate this system with?
Eg if its mostly going to be integrated with frameworks, then MVC would be the way to go, but you'd probbaly alienate users who have a home brew PHP app

If you do it OO, wrap the forum object as a library, an interface to the stuff like config etc, have your views broken down already, so it could easily work in both scenarios
#29

[eluser]TheFuzzy0ne[/eluser]
The reason I seem to change my mind is when I hit problems that don't have a sensible solution. Granted, this should be covered in the planning, but my planning is terrible. I always forget something...

I'm hoping that this forum (for the meantime anyway), will work with CodeIgniter only. In theory, if I can make it good enough, it should get more people interested in using CodeIgniter.

Anyhow, what's the final verdict as to how I should go about doing this? I can probably think of at least 100 different ways (a few of which we've discussed). Every time I get what sounds like a decent idea in my head, I over-think it and screw it up completely.

You've suggested a model for forums and threads, please could you elaborate on that?
#30

[eluser]TheFuzzy0ne[/eluser]
OK, I've been thinking about how to do this, and I still haven't got anywhere. The trouble is, if I break this down into two models, I'm not sure where the line is between them, and I seem to get methods confused between the models. For example, get_thread. This should be in the thread model, shouldn't it? Or should it be in the forum model?

Also, I'm not sure how I should get the data that's meant to go into any given forum page (i.e. any child forums and child topics). Forgive me if the answer it painfully obvious, but I really am stuck here. Any input appreciated.




Theme © iAndrew 2016 - Forum software by © MyBB