Separate collection class or static methods in thmain class?
Posted: Sun Sep 02, 2007 7:14 pm
Weirdan | Please use
Now if I need a function 'getAllStudents()' that return a list of all students,
where should I put that function?
Should I put it inside 'Student' class? or should I create a new class for it?
Thanks
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi, I'm new to oop and I have a question about it.
Let's say that I have a 'Student' class with a few functions:Code: Select all
class Student{
public function addStudent();
public function deleteStudent();
}where should I put that function?
Should I put it inside 'Student' class? or should I create a new class for it?
Thanks
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]