The state of the shape should be reflected by its methods, not contradicted by 
them.

The position of a Shape is a property of a Shape given to it by its designers 
and  it represents its position in user space. It didn't have to have that 
property at all, as  we can define a Rectangle's width and height without 
referencing it's position in any space as we do in geometry.

Having defined that property , its incumbent upon the API to now either keep 
the state current or declare that Shape is immutable. If a Shapes position is 
immutable, then say so. I have never seen anything to indicate that this was a 
design decision, but then again all that means for sure is I've never seen it.

I use Rectangles in headless applications, quadtrees and the like, where their 
immutable position is of no consequence to me, just because of the quirks of my 
application. That's not the normative case. The normative case is Shapes appear 
on a screen and are as such are inevitably going to be subject to positional 
mutation.

There's always a way to program what you want, granted, but that's not to the 
point. We understand the model view controller paradigm. The point is, shapes, 
because of their screen-based environment, should have an API that let's you 
put them at point x, y by assigning that point as their ULHC as you can 
components.  Who cares how it's implemented underneath that layer?

Either the API developers are going to program that functionality or developers 
are going to do it over and over again for themselves, because somehow the 
model has to be brought into sync with the view. It's not just some 
application-specific  specialized functionality we're talking about here- it 
goes to the heart of what it means to be a Shape on a screen before user's eyes.
[Message sent by forum member 'swv' (swv)]

http://forums.java.net/jive/thread.jspa?messageID=227926

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to