|
From: Robert Bralic on 31 Aug 2005 05:30 Dear, Can anybody tell me what is diference in object programming beetween object, thing, and creature.... And how methods can universaly bee developed to objects, things, and creatures...?? Thanks in advance, Robert...!!
From: Phlip on 31 Aug 2005 08:50 Robert Bralic wrote: > Can anybody tell me what is diference > in object programming beetween object, > thing, and creature.... The definition of "object" is a great matter of debate on this forum, where we discuss Object Oriented programming. It is a part of a program with identity, state, a lifespan, a group of methods, and an inheritance of default state and methods. Things and creatures are topics of various tutorials on OO programming, and their definition varies. > And how methods can universaly bee > developed to objects, things, and creatures...?? Methods are not universal. Each object in an OO system responds to specific messages by executing specific methods. Messages are the names of methods, and methods are functions bound to that object to provide its behavior. From here, read /Design Patterns/ to learn how to write OO programs, and what some healthy OO designs look like. No things or creatures. -- Phlip http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
From: H. S. Lahman on 31 Aug 2005 12:36 Responding to Bralic... I will assume this isn't a homework problem that you could look up in a course textbook. > Can anybody tell me what is diference > in object programming beetween object, > thing, and creature.... Things (inanimate) and creatures (animate) live in the real world where the problem being solved is defined. However, there are different sorts of "real worlds". For example, mathematics or 3GL compilers are entirely conceptual but still "real". In the OO paradigm we think of those "real worlds" as problem spaces as a generic terms. Also in the OO paradigm we abstract the denizens of the problem space as objects. Since objects abstract things, creatures, and concepts indiscriminately, the generic term we use for whatever is being abstracted is 'entity'. Thus an object abstracts the intrinsic properties of some identifiable entity from some problem space. To solve a particular problem we are only interested in the entities from the problem space that are relevant to the problem (i.e., that know or do things that ee need to solve the problem). We also abstract the intrinsic properties of the entity that are relevant to the problem in hand. In the OO paradigm we can only express those properties in terms of what the entity is responsible for knowing and what it is responsible for doing. So we cannot abstract properties like purpose or loyalty directly. We need to /represent/ them somehow as knowledge or behavior responsibilities. Thus the object abstraction is not the same as nor even an exact representation of the underlying entity in the problem space. It is a tailored view than enables us to solve the problem in hand more easily. > And how methods can universaly bee > developed to objects, things, and creatures...?? I am not sure what you are asking here. I will guess that you are asking how inanimate entities can have behaviors in their abstractions. The answer to that lies in what software does. Basically software replaces actions that people would ordinary do when solving problems. However, we do not model people directly. (Why not I will get to in a bit.) So we have to map those activities onto the inanimate entities that we do abstract. That process is called anthropomorphization and it is very common in software development, even non-OO development. Part of the job of OO abstraction is to provide a systematic framework that will make it easier to organize those human activities within the constraints implied by things like maintainable code. We do that by ensuring there are logical associations between the human activities and the inanimate entities. Thus if we want to provide environment control behaviors for HVAC in a skyscraper, we associate the control behaviors with a Skyscraper object rather than a Rapid Transit Train. That sort of thinking during anthropomorphization gives us a good skeleton for organizing the behaviors that is tied to the invariants of the problem space. Note that 'creature' is a special case. Since people are creatures, there is a strong parallel in the all creatures do things. So, unlike inanimate objects, they already have intrinsic behavior responsibilities. So why not just abstract People creatures to provide control? The answer lies in the fact that all people <potentially> do the same things. We can't distinguish what they do the same way we could for different flavors of creatures (e.g., Gazelle vs. Whale). In addition, almost all of the complex problems we need to solve involve a /lot/ of very complex actions that people do. So if we abstracted People objects to do all the things needed in a typical software problem solution we would have huge objects with myriads of responsibilities. That becomes intractable for software maintainability because the People object would contain almost everything the program did. To manage complexity and provide more maintainable software, we need to break up those behavior responsibilities and spread them across multiple objects. So we have the methodological rule that human activities must be abstracted and allocated across (delegated to) multiple inanimate objects via anthropomorphization. ************* There is nothing wrong with me that could not be cured by a capful of Drano. H. S. Lahman hsl(a)pathfindermda.com Pathfinder Solutions -- Put MDA to Work http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman (888)OOA-PATH
From: jasongorman on 4 Sep 2005 14:49 responding to Robert Bralic: "Can anybody tell me what is diference in object programming beetween object, thing, and creature.... And how methods can universaly bee developed to objects, things, and creatures...??" Can of worms, anybody? There's a risk here of starting a philosophical debate about the nature of reality and why Object Technology is the work of the Devil and all his evil minions (or is that "evil croutons"?). Some people talk about objects as a computing technology. They'll say that objects are data structures (records) that are assigned to the heap instead of the stack and that they have private member variables and public interfaces that abstract their internal implementations and reduce coupling between software components. They'll talk about inheritence and polymorphism and blah blah blah. Other people will talk from an analysis perspective and say that objects represent "things" - real or imagined - that have a unique identity, attributes, relationships and rules that apply to them. They might even say that objects are the targets of verbs, and that the difference between a "thing" and an "object" is that a "thing" isn't necessarily having anything done *to* it. Myself, I think all of these things are true. Objects are a useful analysis tool for understanding a large array of logical problems. They are also a cool way of organising your code to make it easier to understand and to change. The fact that such a useful analysis tool is also a cool way of organising your code is what some might called "serendipidy". Personally, I think the clue is in the phrase "understanding a large array of logical problems". An object is a logical construct for identifying "things" and expressing "stuff" about them in cold, hard logic - should you choose to do so. (And, yes, if you're building software then you *should* choose to do so, at least until a better analysis tool and a better way of organising code comes along...) So, in answer to your question - there's probably no difference between an object and a thing, but I suspect a creature is a thing/object that is actually alive, like a "Universal bee", for example :-) Sounds like rubbish? You betcha! Jason Gorman http://www.parlezuml.com
|
Pages: 1 Prev: Association Class Next: a simple Class diagram need help |