Hi
I have a class which has alot of tasks related to multiple classes.
the tasks are add, modify ,delete, write on a file and read array from a file.all theses methods operates on objects of other classes as a member variables.
In other words, I have to perform a group of functions on multiple objects ,actually the same functions must be performed on all objects (which are from different classes).
so how can I seperate the tasks?
thank you in advance.
creative_m 0 Light Poster
Recommended Answers
Jump to Postwhat exactly do you mean?
your explanation makes no sense, it's like saying: I'm writing a method add() or multiply() which has to be able to take a String as well as a Double, and has to be able to be applied to as well a String instance as a …
Jump to Postbesides, why do you think methods that in the same class are not reusable?
Jump to PostMaybe those method definitions belong in the class they apply to, ie in Student there is a delete(Student s) method, in Course there's delete(Course c) etc etc. (These should probably be just named delete() defined as instance methods.)
In a typical controller class you will call those methods, but …
All 10 Replies
stultuske 1,116 Posting Maven Featured Poster
NormR1 563 Posting Sage Team Colleague
creative_m 0 Light Poster
NormR1 563 Posting Sage Team Colleague
stultuske 1,116 Posting Maven Featured Poster
creative_m 0 Light Poster
stultuske 1,116 Posting Maven Featured Poster
creative_m 0 Light Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
creative_m 0 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.