Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » why not state oriented?
why not state oriented? [message #19905] Sat, 31 January 2009 15:18 Go to next message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member
Hi to all!

In the manual about Draw I've read the *state oriented* approach were not reality here, you devs will rather prefer args instead (alike with FileOut the put32le() etc.).

I always have considered the states less cumbersome, and it results in a less number of args.
I will often call the paintLine() a lot of times, but the lines are always blue and have 4 pixels, then I can surround a rect with the same one.
Setting a var of my class I have always a "current state", hardly to avoid.

At the Apple you set a pen you can use subsequent, until you set a new one again. The "graphics context", as they call it, is treatened similar. Thats basically like at WIN-GDI (though these two systems have obvious differences for devs).
At the Apple they are also not starters there, so it seems a question of taste.

What is the advantage of using args instead?
OK, I'm spared of calling set-get-functions all the time, thats one thing after all, so the one call will do in some cases.

Martin
Re: why not state oriented? [message #19914 is a reply to message #19905] Sun, 01 February 2009 18:42 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amando1957 wrote on Sat, 31 January 2009 09:18

Hi to all!

In the manual about Draw I've read the *state oriented* approach were not reality here, you devs will rather prefer args instead (alike with FileOut the put32le() etc.).

I always have considered the states less cumbersome, and it results in a less number of args.
I will often call the paintLine() a lot of times, but the lines are always blue and have 4 pixels, then I can surround a rect with the same one.
Setting a var of my class I have always a "current state", hardly to avoid.

At the Apple you set a pen you can use subsequent, until you set a new one again. The "graphics context", as they call it, is treatened similar. Thats basically like at WIN-GDI (though these two systems have obvious differences for devs).
At the Apple they are also not starters there, so it seems a question of taste.

What is the advantage of using args instead?
OK, I'm spared of calling set-get-functions all the time, thats one thing after all, so the one call will do in some cases.

Martin



Well, I guess there is no really strong argument for either side.

I guess it rather depends on what you want to do. For drawing widgets, context-less approach is better, as in fact only operations required are DrawText, DrawImage and DrawRect. Mostly for all of them, passing arguments is quite simple while maintaining the context logic is a bit more complicated.

Mirek
Previous Topic: What is the purpose of "typedef MyClass CLASSNAME"?
Next Topic: More GLCtrl
Goto Forum:
  


Current Time: Fri Apr 26 01:41:39 CEST 2024

Total time taken to generate the page: 1.01139 seconds