I am trying to create a class with the following generic methods: Input, Process, Output. The Process method is actually another abstract base class with a bunch of derived classes, all doing different processing. These Process classes will not change, nor are they expected to be derived further. The Input and Output methods have to customized and will be derived.
My current design is something like:
<pre>
class IO {
Stuff in(){}
void out( Stuff){}
}
class Process {
IO _io;
Process( IO io){ _io=io}
void doIt() {
Stuff s = _io.in();
do stuff;
_io.out( s);
}
}
</pre>
It's impossible to say anything about your code, we do not know the related classes structure nor what exactly do you want to do... Please post more info.
Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?
I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S(from: bash.org.ru)
//always looking for job opportunities in AU/NZ/US/CA/Europe :P
willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"); USE [code] TAGS!Read this FAQ if you are new here. If this post was helpful, please rate it!
I don't have code - I am designing. My pseudocode should look like:
Code:
class IO {
Stuff in(){}
void out( Stuff){}
}
class Process {
IO _io;
Process( IO io){ _io=io}
void doIt() {
Stuff s = _io.in();
do stuff;
_io.out( s);
}
}
I only have 2 base classes, IO and Process. IO is an abstract class that needs an 'in' and 'out' routine to get data into and out of the Process class. The Process class is a factory? class, that has different subclasses that all use the in/out methods, but process the data differently. The Process subclasses are known and final. The IO class implementations are derivable.
Bookmarks