Reputation: 6091
Is there a naming convention for the following scenario:
I have a project which will basically act as an ETL layer, so it will take in "something", transform it and output "something". Most of the times this is db or csv input and xml or db output. I am not too sure about using Input and Output as they have file specific connotations.
I am wondering if there is a convention for the input and output side of things e.g. IInput, ISource IOutput, ITarget, IDestination
Is there an accepted convention?
Upvotes: 0
Views: 1418
Reputation: 1899
If you look at .NET, their solution to input / output (if you look at the streams) is to have a base stream and then stream that inherits from that stream, incorporating the name of the object (MemoryStream, FileStream). The direction is not promoted to be a part of the file neither it is promoted to be implemented in a separate stream object. Instead the base stream asumes bi-directional data flow and provides a holders (properties) that the inheritor can set to explicitly say if it supports both directions or just one of them (CanRead and CanWrite in the stream scenario).
From there they have two helper objects which implement read / write (StreamReader and StreamWriter) on the base stream (not using any of the concrete implementation methods, just the base Write, Read, Seek methods).
So they are basically splitting the Stream not by the data direction (input / output) but by the type of the underlying datasource (Memory, File, etc).
The StreamReader and StreamWriter simply take advantage of the Contract that the base Stream object imposes on all of its successors. Not quite sure if this is applicable in your case but I think it is woth to think about it.
Upvotes: 1