The Artima Developer Community
Sponsored Link

Weblogs Forum
Thinking about objects

23 replies on 2 pages. Most recent reply: Jan 19, 2005 3:30 PM by Pronob

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 23 replies on 2 pages [ « | 1 2 ]
Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Real Objects Posted: Jan 3, 2005 11:07 AM
Reply to this message Reply
Advertisement
Mostly I see you comparing Java and C++. These languages (not necessarily their runtimes) are pretty similar and neither one does a particularly good job of being "Object Oriented".

The term "Object Oriented", you'll recall, was coined by Alan Kay to describe the core idea behind Smalltalk. Smalltalk remains the gold standard in OO development and has served as the base evironment for the implementation of a number of other programming environments such as Self.

If you look into it, I'm quite certain you'll find that there isn't a single OO language that contains features that can't be implemented naturally and more interactively in the Smalltalk environment.

The key problem is all the cheap OO knock-off languages that don't deliver the entire real deal. Java being one of them. The original JVM was designed on the cheap to support the semantics of this bit of cargo cult engineering and consequently it has awful dynamic dispatch performance and lots of other limitations that make it unsuitable for dynamic languages.

OTOH, its not particularly difficult to execute a language like Java in a Smalltalk VM. All of the strict static typing stuff (which I once believed in with great zeal in my C++ days and now regard as little more than annoying superstition) is all compile time stuff anyhow. It doesn't do you any good at all once you get to runtime.

The key is to have a VM that implements all of the features implied by "Object Oriented".

Gregg Wonderly

Posts: 317
Nickname: greggwon
Registered: Apr, 2003

Re: Thinking about objects Posted: Jan 5, 2005 3:58 PM
Reply to this message Reply
Yeah, MSIL and .NET are infact the elephant in the living room. However, both are really just the result of Microsoft learning how powerful JIT, and many other concepts that Java first presented really are. They would have just continued to call it Java if Sun wouldn't have took them to court for breaking the contract.

Without trying to bash MS, the fact really is that the JVM, or MSIL as a spec both standardize every darn bit of detail that needs to be specified to allow everything about and object to flow between distributed systems.

So, why is it that we can't just pick one such specification and move on? MS created C++.Net/managaged C++ by reducing C++ to everything that would fit within MSIL. They'll probably still expand MSIL to cover some other things.

Sun is doing that with the JVM. Look how much technology waste is being created by two, such large duplicate efforts that solve the same problems (distributed systems integration) the same way (fully specify the closure of interactions).

Mark Tippetts

Posts: 3
Nickname: ubergeek
Registered: Jan, 2005

Re: Thinking about objects Posted: Jan 7, 2005 4:16 AM
Reply to this message Reply
Jim,

You wrote:
I've been doing some thinking about objects recently… I, at least, need to be reminded about the basics every now and then, and think about what I do without thinking about it…  I want to ask the question of whether objects are something that we can believe in without believing in the objects of a particular kind expressed in a particular language, or if there is something more abstract about objects.


While reading your post, I was struck by the similarity of the concepts you discuss to those dealt with in Structural Linguistics (and Structuralist philosophy generally). I refer specifically to the distinction between signifier and signified, which refer respectively to the concrete encoding of a sign and the abstract concept encoded by the sign. For example, the letters: “r-o-c-k” make up the signifier, while the concept “rock” is signified (an actual rock, as distinct from the concept of a rock, is sometimes denoted by a third term, the referent). It’s noteworthy that, while the phonemes that sound out the word “rock” and the letters that spell this word are different encodings (signifiers) of the same sign, the words “rock” and “stone” are completely different signs, albeit with the same referent.

I’m going into these terms because they correspond to concepts in the Object-Oriented paradigm, and I believe the conclusions of Structuralism have a direct bearing on the issues you raise. The OO concept corresponding to the signifier is the Object – which is a concrete instance, and that corresponding to the signified is the Class – which is an abstract definition. Now, it’s clear that instances of objects, like the signifiers of signs, are completely platform/language-dependent, because they are concrete encodings. What’s less clear, and what seems to be the intent of your post, is whether the class of objects is language-independent or not.

In your post, you mention translation problems as evidence for language-dependence:

Now, in what sense are Java objects the same as C++ objects? There is the conceptual similarities (both are abstractions of state, allowing polymorphic typing, etc.) but they are very hard to translate from one idiom to the other. This is something that becomes most clear when one gets asked (generally by a manager) to "translate" a program written in C++ into the Java language. Even though these two languages are both concerned with objects, there is no real sense in which one can translate a program written in one into a program written in the other; at best one can write a new program that does the same things in the new language. But this isn't translation, this is writing a new program.


In response to this, I have to ask how the creative element in translation from C++ to Java would differ from the creative effort needed to translate, e.g., a document from English to French? To say that production of a text in language B, based on and with the same information content as a text in language A, is not translation, is to violate the meaning of the word. Certainly, a mechanical translation, as in an XSLT transform, is a trivial exercise of the translator’s art. In general, the more dissimilar languages A and B, the greater the creative effort necessary to retain the original meaning in translation.

Returning to the concepts of Linguistics, we find that languages differ not only as to the particular signs making up the languages, but also as to the rules governing semantic and grammatical relationships between signs. Nevertheless, all languages are made up of signs, and there exist paradigmatic and syntagmatic rules governing all languages. These meta-linguistic rules are what enable the Semiotician to speak of the meaning and behavior of signs in general, without reference to specific signs in any particular language.

Similarly, the meta-linguistic properties of objects allow us to speak of objects in abstraction from any specific language. Inheritance corresponds to the Semiotic concept of paradigms (which differs, obviously, from the Khunian sense of the word), while collaboration corresponds to the syntagmatic dimension of language. Naturally, the rules governing inheritance and collaboration will vary from one programming language (or language group) to another, just as they do among human languages. Nevertheless, the universal presence of some such set of rules means that objects have a very real and definite abstract meaning.

Now, I’ll grant you, thinking about objects as having a language-independent reality on this level of abstraction is probably not what you want. All well and good that objects can exist on this rarified level, but what we want is to be able to work with them. But naturally, to use objects, we would have to define rules governing their interactions. But, since ‘a set of rules governing the interactions between signs’ is the very definition of a language, it is not only impossible, but inconceivable that we might have a language-independent way of using objects.

Mark Tippetts

Posts: 3
Nickname: ubergeek
Registered: Jan, 2005

Re: Thinking about objects Posted: Jan 7, 2005 4:22 AM
Reply to this message Reply
My apologies about the formatting of this post. Obviously, something went very wrong when transfering from my word-processor to the form field.

Matt Gerrans

Posts: 1153
Nickname: matt
Registered: Feb, 2002

Re: Thinking about objects Posted: Jan 7, 2005 12:26 PM
Reply to this message Reply
I think it was caused by the use of the pre tag on the quoted text; you probably intended to use italics.

John D. Mitchell

Posts: 244
Nickname: johnm
Registered: Apr, 2003

Abstractioning Posted: Jan 7, 2005 2:12 PM
Reply to this message Reply
But, if you're just devolving the problem to that which we can talk about in terms of the meta-linguistic language used to talk about the nature of e.g., classes, instances, etc. than (A) we've lost touch with the manifestation (i.e., reality) and (B) we're still back talking about a language in terms of another language (just at a more abstract level).

To be clear, I'm certainly not saying that those are bad things. But this whole notion of trying to be "independent" of language is just plain silly.

[As the story goes... The chicken always knows. :-? :-)]

Mark Tippetts

Posts: 3
Nickname: ubergeek
Registered: Jan, 2005

Re: Abstractioning Posted: Jan 8, 2005 4:05 AM
Reply to this message Reply
> But, if you're just devolving the problem to that which we
> can talk about in terms of the meta-linguistic language
> used to talk about the nature of e.g., classes, instances,
> etc. than (A) we've lost touch with the manifestation
> (i.e., reality)

My intent was this: Jim raised a very important question, the answer to which is not obvious from contemplation of the immediate field of manifestation. But as I read his post, it struck me that an answer to this question was already provided, in the seemingly unrelated field of Semiotics. Since the findings of Semiotics form the paradigm of Structural Philosophy, which has applications in such diverse fields as literature, biology, economics and psychology, they just might have relevance to computer science as well.

The most basic concepts of Semiotics seem to address fundamentals of Object Orientation, specifically the question Jim raises. If that is indeed the case, an exploration of other Semiotic principles might be very illuminating for our understanding of objects. Since I was just replying to an interesting post on a blog, and since I'm not myself a semiotician, I only went as far as I did in exploring this connection.

> and (B) we're still back talking about a
> language in terms of another language (just at a more
> abstract level).

Ultimately, the process of development is the process of translating from the language of concepts and mental constructs to the language of bits and chips. I'll freely admit, my own interests run more to understanding the first term than the second, so for me these high-level philosophical discussions are still very much in touch with "reality." There's a thousands-year-old tradition of Natural Theology that says we can learn about the nature of God by contemplating His works. The take-away point from that is that we can understand entities (ourselves) by contemplating the artifacts of their behavior. Since software development is such a pure manifestation of mind, it seems an especially powerful tool in this regard.

I can see someone reading the above and thinking, "Well, that's very nice, but it has nothing to do with computer science." I would remind that reader that historically, interdisciplinary studies have been illuminating in both directions. I mentioned Natural Theology because it is precisely this area of endeavor that led to the development of the scientific method. There is a continuous flow of information from metaphysics to physics to technology and back. One of the lessons of the history of science is this: the most important breakthroughs (Khun's paradigm shifts) have come, not from the acquisition of new data, but from the development of new perspectives, models, and methodologies for dealing with existing knowledge.

Returning to the subject of my first post, my thinking goes like this: Having seen that there are significant correlations between the Object-Oriented paradigm and certain basic principles of Semiotics, might not Semiotics have something to teach us about how we should design and use computer languages? I think it's no accident that Perl, one of the most versatile and powerful languages ever developed, was created by a linguist. After all, the rich expressiveness and utility of human language is the far-distant standard towards which computer science strives. As one poster on this thread put it, in our current primitive state, we're stuck laboriously telling computers how to do things, instead of telling them what we want done.

> To be clear, I'm certainly not saying that those are bad
> things. But this whole notion of trying to be
> "independent" of language is just plain silly.

Put that way, you're surely right. But this notion of independence has its origin in the search for greater interoperability, which is not silly. There's a constant tension in the IT community between those who want the best tool for a specific job (and tend to proliferate languages and protocols as a result), and those who want to lower the barriers to communication between systems (and tend to proliferate standards and books on patterns ;).

I don't think that tension is going to go away, because the creation of any standard always involves trade-offs. More fundamentally, true standardization would have a terrible impact on innovation, which always involves something non-standard. So, as long as there is a need for specialized tools and innovative approaches, there will always be problems of interoperability, and a consequent value in understanding these meta-linguistic issues.

That got a bit long. Huh.

Gregg Wonderly

Posts: 317
Nickname: greggwon
Registered: Apr, 2003

Re: Thinking about objects Posted: Jan 18, 2005 9:20 PM
Reply to this message Reply
> Now, I’ll grant you, thinking about objects as having a
> language-independent reality on this level of abstraction
> is probably not what you want. All well and good that
> objects can exist on this rarified level, but what we want
> is to be able to work with them. But naturally, to use
> objects, we would have to define rules governing their
> interactions. But, since ‘a set of rules governing the
> interactions between signs’ is the very definition of a
> language, it is not only impossible, but inconceivable
> that we might have a language-independent way of using
> objects.

Even in world politics, language (dis)simularities can create barriers for interworking when the right translations are not available. Standardizations in the form of specifications that everyone agrees to is an important factor. Having a worldwide view of the value of currency has made it possible to freely interact with a distant economy. In my mind, its that kind of playing field that makes it possible for integration at all scales.

XML works for some applications, but I believe that there are many where a simple binary standard protocol would be just fine. The byte ordering and bit ordering fiasco that the C language created by not demanding standards as Java has created quite the stack of issues.

C++ perpetuated that as well. We never got standard libraries embedded in the language spec for manipulating binary streams. Everyone tired of doing that and then suddenly the full specificity of XML felt really good. Unfortunately it doesn't make protocol libraries small because you need a SAX parser at a minimum and then you need a buffer big enough to hold the largest semantic element of the document structure (with SAX, and the whole document in some cases).

With a strict binary structure, we get a much simplified ability to pass data effeciently from a network perspective, from a code size perspective and from a memory use perspective. All the dynamic String creation in Java SAX parsers can really swamp the GC. One has to write some really specialized caching code and reimplementations of String to optmize memory reuse.

There are some simple techniques in binary protocols to allow for new versions of the protocol to be created. We've seen this with IPv6 and others. Protocols like MODBUS though widely used are limited by their designs, so there are great examples of poor binary protocols.

Maybe someone will write a nice simple description of binary protocol design that others can draw on. Or, better yet we could just use an existing protocol like RMI for the simple RPC cases, and use a more direct socket approach for better bandwidth usage.

I recent created a simple to use RemoteInputStream class that you create on a server. You pass it the address and port for a ServerSocket that you've created and a 128bit magic number for ID. You serialize it to the remote JVM. When it gets there, during deserialization, it connects back to the server, and sends the ID across. Because it subclasses InputStream, you can then pass this remote reference into code using an InputStream and it will read the data comming from the server.

In this case, its the features of the Java language that enabled me to solve the problem in a way that would not be trivial in other languages that don't include code downloading and security. The 128bit ID is not security, it is more of a version check mechanism in this application.

Because I can use a smart proxy to wrap the object, I could implement a completely secure socket connection using SSL and a key exchange.

Demanding the support of so many outdated programming paradigms that continue to do nothing but plague users and developers with complexity and lack of reliability, is a poor choice. As was mentioned earlier, MSIL is a new direction for Microsoft, and in that definition, they have eliminated some of the more perilous programming paradigms of the languages supported by the MSIL.

Pronob

Posts: 1
Nickname: pronob
Registered: Jan, 2005

Re: Thinking about objects Posted: Jan 19, 2005 3:30 PM
Reply to this message Reply
I believe Jim is pointing to a serious issue.How do we use objects? At one level we say objects are entities with behaviours- at another level we say objects are code and instructions. Although these two descriptions are refering to the same objects they are not talking about the same things. This dichotomy with the description of objects come from how we instantiate objects in our program and then invoke methods/send messages to them. By the time we start to do that we are already in the wrap of some programming language syntax :smalltalk or java or C++ .
This problem is due to the relationship with the base operating system. Operating systems do not gaive us objects which we can address using any language we choose. If unix is closer this ideal object oriented operating system than DOS then we have to go a few more steps past unix in designing a new operating system where we invoke an object in our universe created by this operating system, before passing any message to it and in return, the original object leaves us with another resultant object in our operating systen universe and the process continues. When we write programs we do the same -programatically. When user uses the system, user talks to certain objects left by the execution of my programs.


To be able to describe objects at the operating system level we need to give expression to actions or intentions of our system in terms of pure sentences just as we describe variables in our programs. This gives us effectively two new data types in our array of basic data types like strings and integer -the first new type can be called "intentions" or "actions" describe the function/action/requirement. The second data item is "keyitems""Keyitems" -which is equivalent to variables but is not associated with specific data type like Strings or int. Our new objects will be a collection of Actions /Intentions and Key items. We use programming language syntax to expand these intentions/actions into instructions and to establish Keyitems as data structures.

Flat View: This topic has 23 replies on 2 pages [ « | 1  2 ]
Topic: Deployable Units and Layers Previous Topic   Next Topic Topic: Code Reuse: At the Program Level

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use