15 july 20151cse3210: lecture 11 components, controls and programming design issues cse3210:...

27
March 21, 2022 1 CSE3210: Lecture 11 Components, Controls and Programming Design Issues CSE3210: Software Component Technology Lecture 11 Dan Eaves

Post on 22-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

  • Slide 1
  • 15 July 20151CSE3210: Lecture 11 Components, Controls and Programming Design Issues CSE3210: Software Component Technology Lecture 11 Dan Eaves
  • Slide 2
  • 15 July 20152CSE3210: Lecture 11 In Tute 10 You Created a Control It was an alarum clock of sorts Well, actually a rather nasty and incomplete one (Assignment 2 will involve making it into a thing a beauty and a joy forever!) First you developed the control, compiled it, and then added a form to your development environment to test it. That is, of course, the wrong sequence. First we have a form Then we add a control to it from the Toolbox
  • Slide 3
  • 15 July 20153CSE3210: Lecture 11 Where oh where has my little control gone? Not to be found. But still alive!
  • Slide 4
  • 15 July 20154CSE3210: Lecture 11 Its Just Living Where I Put it!
  • Slide 5
  • 15 July 20155CSE3210: Lecture 11 Good Old ctlClockLib.dll
  • Slide 6
  • 15 July 20156CSE3210: Lecture 11 Now Weve Got It!
  • Slide 7
  • 15 July 20157CSE3210: Lecture 11 But Look Where Theyve Appeared!
  • Slide 8
  • 15 July 20158CSE3210: Lecture 11 Look at all those (inherited) properties. But the metadata is missing!
  • Slide 9
  • 15 July 20159CSE3210: Lecture 11 Flat Versus Hierarchical There have been a number of questions regarding my use of: Flat to refer to controls and components Hierarchical or deep to refer to class libraries There seems also to be confusion as to why I think the flat approach is better than the deep The issue is critical to the nature of component- based programming, and to why it is seen by many as a good approach.
  • Slide 10
  • 15 July 201510CSE3210: Lecture 11 Namespaces Probably three primary purposes Make inadvertent duplications harmless You can use the same word in two places and they wont clash (cause side-effects) Provide logical organisations and sub organisations for a complex set of tools Its easier to learn something thats logically organised that something thats just a large pile of stuff Reduce the need for typing Once youve declared your use of a namespace, you dont have to keep typing it over and over Example System.Runtime.Serialization.ISerializable
  • Slide 11
  • 15 July 201511CSE3210: Lecture 11 Other Strings of Full Stops Note that non-hierarchies can also apply in programming cmbNames.Items.Add (Fred) Verb: acts on collection Property (collection) Particular Combobox Data to add to collection
  • Slide 12
  • 15 July 201512CSE3210: Lecture 11 Human Cognitive Characteristics Working Memory: 7 2 chunks Long Term Memory: countless chunks Declarative Memory conscious access Semantic, e.g. Monash is in Melbourne, Australia Episodic, e.g. the last party you went to Production Memory unconscious access Where expertise exists What can be done without thought at the right time: I write cmbNames.items.add(Hannah) without thought You probably dont I can create most of a normalized database without thought and recognize likely problems requiring close thought. You probably cant
  • Slide 13
  • 15 July 201513CSE3210: Lecture 11 When Learning a (Programming) Language There are words you use without thinking: Chunks in Declarative memory Application.exit For i = 0 to ubound(myarray,1) There are the words you almost know There are the words you dont quite know but know about There are the words youve never met There are the same classes of knowledge of the various program structures
  • Slide 14
  • 15 July 201514CSE3210: Lecture 11 When Designing a Programming Language Do we design for power in use? Do we design for ease of learning? Do we design for some middle ground? We now pause this discussion for a special digression
  • Slide 15
  • 15 July 201515CSE3210: Lecture 11 Lets Think about Some (Real) Experts Say, musicians, surgeons, cabinet makers, tailors, cooks, dressmakers, artists, card sharks, programmers, mathematicians, earthmover drivers They are all always practicing, performing or working their craft. As musicians say, they dont want to lose their chops: the automatic technical skills which fade away without continuous practice
  • Slide 16
  • 15 July 201516CSE3210: Lecture 11 Little Known Fact The house paint you buy isnt the house paint housepainters buy Housepainters buy paint that only skilled painters can use Fulltime housepainters are experts too
  • Slide 17
  • 15 July 201517CSE3210: Lecture 11 So, Should One Programming Language Fit All? There you are, using the programming language of your choice (probably C++ or C#) You program 6-10 hours a day Youve been doing this for 5 years You are getting to be a journeyman programmer Of course, there are the naturals, the instant gun programmers. Just like there are gun musicians who are 10x better than the average musician. But there arent very many of them And you probably arent one of them And they are going to design the programming languages for you????????? Well, they have
  • Slide 18
  • 15 July 201518CSE3210: Lecture 7 Heres that (damn) Chart Again! Note that it doesnt take into account either the experience or use patterns of the programmers Skill Application Functionality C++ MFC ATL COM.NET VB 6 Where components are used Where components are built
  • Slide 19
  • 15 July 201519CSE3210: Lecture 11 Deep Versus Shallow How many steps does it take to get somewhere Exit Application.Exit() MessageBox.Show(Message,,,) MsgBox Message In both cases, the longer version is Better (more accurately reflects whats going on, is self-documenting) Harder to learn Longer to type
  • Slide 20
  • 15 July 201520CSE3210: Lecture 11 However Those long well dotted strings give you access to the complete power of the computer Everything is there And with 6-12 hours a day of practice, its all really well chucked in your declarative memory Programming is like writing a letter, designing is the fun stuff where you have to think and be creative Anything else is like giving Mark Knopfler a ukulele
  • Slide 21
  • 15 July 201521CSE3210: Lecture 11 OO Languages are Inherently Complex The language is extended by writing new classes in the language Class reuse frequently takes the form of class modification, and then extension, which is the opposite of reuse The single logical structure means that the language (the words used, not the structures) is continuly growing not only in word count but structure count. There are no new structures, just an ever growing number of new sets of words structured the same ways.
  • Slide 22
  • 15 July 201522CSE3210: Lecture 11 OO Languages are Inherently Hard to Learn A significant portion of the class libraries must be mastered to get started. The human working memory limits are regularly exceeded, slowing progress. There are few inherent structures to build logically related chunks around But if you survive your 5 year apprenticeship, boy! You pays your money and you takes your choice Me, Ill use components
  • Slide 23
  • 15 July 201523CSE3210: Lecture 11 fred fred
  • Slide 24
  • 15 July 201524CSE3210: Lecture 11 fred fred
  • Slide 25
  • 15 July 201525CSE3210: Lecture 11 fred fred
  • Slide 26
  • 15 July 201526CSE3210: Lecture 11 fred fred
  • Slide 27
  • 15 July 201527CSE3210: Lecture 11 fred fred