Rommeo Posted February 9, 2009 Share Posted February 9, 2009 Hi, i m trying to code my own-blog. i m familiar with how to create classes etc. But the problem is i can't decide about the classes i will use. How do you decide about it ? Is there any modeling program/or a program/or a way that you decide about classes ? For example: for my own blog i did something like this for now; pageClass ( header, buttons, content, rightmenu,footer ) postsql ( insert, delete, update ) blog( post, comments ) i know probably its completely wrong, so as i m a newbie i would be glad if you can help. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/144549-cant-decide-the-classes/ Share on other sites More sharing options...
coder_ Posted February 9, 2009 Share Posted February 9, 2009 Sit down, take a paper and a pencil and write all your blog behaviour. When you have all things that want in your blog, it will be clear to you what classes you need. Quote Link to comment https://forums.phpfreaks.com/topic/144549-cant-decide-the-classes/#findComment-758541 Share on other sites More sharing options...
sKunKbad Posted February 9, 2009 Share Posted February 9, 2009 Maybe procedural coding would be easier for you. I can use OOP, but prefer procedural. Quote Link to comment https://forums.phpfreaks.com/topic/144549-cant-decide-the-classes/#findComment-758542 Share on other sites More sharing options...
Rommeo Posted February 9, 2009 Author Share Posted February 9, 2009 Thank you sKunKbad. By the way which classes would you use for to code your own blog ? Quote Link to comment https://forums.phpfreaks.com/topic/144549-cant-decide-the-classes/#findComment-758549 Share on other sites More sharing options...
trq Posted February 9, 2009 Share Posted February 9, 2009 Your question is pretty hard to answer definitively as it really depends on you. However, objects should describe things. These things should be concise and to the point. eg; There's no point in having a massive page object that is responsible for everything, what makes up your page? A menu, threads, comments? These could all be broken down. Your blogs object for instance could return multiple article objects which in turn could return multiple comment objects. This may (especially in the case of something as simple as a blog) be overkill however, breaking your application down into smaller components should give you more of an indication as to what objects (and therefore classes) you will need. Quote Link to comment https://forums.phpfreaks.com/topic/144549-cant-decide-the-classes/#findComment-758561 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.