![]() ![]() In my view, unless I've misunderstood your question, an int is the data type. ![]() On ints, you ask "do I think of an int as the container of the integer. The problem with pipework analogies and the like, is that what you have in scope is not a pipe or even the spigot, but the bucket which is being filled by the pipe and from which you are periodically drawing off water (or the other way around, a bucket into which you are periodically placing water, which is then piped and drawn off elsewhere by mechanisms which are outside of the scope of your code). That is, it is a volatile variable with concurrent access from elsewhere. In my view the best way to visualise a stream, from the point of view of a coder, is as a shared variable. (This convention was for example used in the book Streaming Data: Understanding the real-time pipeline by Andrew Psaltis).īut I give these subjective elements only as additional info on the top of the objective part, since opinions are a matter of taste, and there's no best way to do it. Your large arrow would then be understood as a zoom on such an arrow. This clarifies that there's a direction for reading and another direction for writing and it allows to link the stream concept with conventions of data-flow diagramming, which uses (thin) arrows to connect processes. Streaming Architecture by Ted Dunning & Ellen Friedman).īut maybe do not connect it to a a boxed file, but rather some cloud with a question mark? or at least show some tap on the side of the file to suggest that it's just a possible connection.Īnother alternative is to show the stream like your pipe, but with an arrow on one side. This kind of representation is used in several books dedicated to stream based architetures (e.g. Your first representation of a pipe conveys well the idea. This is why you should not show the stream as a boxed (finished) content, but suggest the uncertainty about the source of the flow in some way. ![]() The potentially infinite size of the data is an important element to get the concept of a stream and more generally stream-based architectures right. ![]() temperature measurements in you house, measurements of factory sensors, etc.) it can be data coming from a network connection that streams a potentially infinite set of data (e.g.it can be a file object representing itself a stream of incoming characters typed on the console, with no end until you shut-down the computer.it can be a file stored on the file system, and that has a finished size.But this abstraction also hides the origin and the size of the stream: There is no standard for representing stream objects.īut as you explained it, the stream is an abstraction of a flow of data. Or do I think about it as the integer only, for example: Same thing for the int data type, do I think of an int as the container of the integer, for example: I think the term "stack of books" in real life only means the stacked books (without having a container that contains the stacked books). Or do I think about it as the stack of integers only, for example: My question also apply to other data types, for example do I think of a Stack of integers as the container of the stack of integers, for example: I think the term "stream of water" in real life only means the flowing water (without having a container that contains the flowing water). Or do I think about it as the stream of data only, for example: How can I think of this FileOutputStream object, do I think about it as a container of the stream of data (i.e. I want to make a small programming tutorial which will have a number of images visualizing various data types, but I am not sure how to draw these images of the data types.Īssume that I have a FileOutputStream object that writes to the file 1.txt. ![]()
0 Comments
Leave a Reply. |