My Blog List

Tuesday, May 31, 2011

STudy Notes: Other Design Patterns, Protocols, and Summary of Mechanisms



* Last part of chapter 7 reviews the other design patterns (besides MVC). Most significantly for me, is that the authors refer to protocols. I have been challenged by protocols in the past

* "When a framework object has been designed to use delegates to implement certain behaviors" (p 153 the behaviors it requires are defined in a protocol.
 Protocols define an interface that the delegate object implements."

* Protocols can be formal or informal. If I use formal protorcols I only have to implement the methods that I need.

*Ways to customize an apps behavior with UIKit include:

•Subclassing
•Delegation
•Target-Action
•Block Objects

Author suggests using his summary cheat sheet at www.dummies.com/cheatsheet/iphoneapplicationdevelopment


Study Notes: Design Patterns: MVC (Part 3) Windows and Views (Part 4)


Study Notes 3: Design Patterns: MVC

P 141

·     The Model View Controller(MVC) is one of the basic design patterns around which frameworks are designed.
·     A design pattern is a commonly used template
·     MVC pattern is populated with 3 kinds of objects
o   Model Objects
§     Engine of the app, app’s data and logic
§     Like a particular t.v. program, independent of set brand and home wiring/cable/delivery method
o   View Objects
§     Displays things on the screen
§     Responds to user actions
§     Anything I see in an app is a kind of view object
§     Like a television screen, independent of program, just displays and responds to my touches on controls by sending info off to whomever it ought to go to
o   Controller Objects
§     Connects apps view objects TO it’s model objects
§     Like the circuitry that pulls the show off cable and sends it to the screen or requests a pay-per-view show

My examples:
M       A dairy
V       A home order form for milk that I fill out
C       The milk woman who looks at my order, puts the milk into her truck and delivers it to my home

M       My home furnace
V       My thermostat
C      
* Ductwork for my furnace that sends heat in
* also whatever mechanism the thermostat triggers that sends a message to the furnace to heat up some air and pump it into the ductwork

Study Notes 4: Windows and Views

·     Single window on iPad an instance of the UIWindow class, created by UIKit
·     A window is a specialized kind of window
·     I add views to the window
·     I don’t directly close or manipulate an iPad window
·     A view is an area on top of the window
·     View is main way that app interacts with users
o   Display content
o   Handle touch events
·     View Hierarchy
o   Content view(s) added as subview(s)
o   A view with a subview is a superview
o   One view 0 to N subviews, 1 superview
o   Subviews displayed on top of their superviews/parents
o   Controls: buttons, text fields, etc are (become) subviews
o   Drawing and Event Handling lowest level subview first rendered. Each subview returns control to its superview after it is rendered
o   UIKit framework handles the view hierarchy relationships
      
·     Kinds of Views (p 148) (are all of these views container views?
o   Container Views
o   Display Views
o   Text and Web views
o   Alert views and action sheets
o   Navigation views
o   (The window) Root container for all other views

Monday, May 30, 2011

Study Notes: Frameworks Part 2


* Frameworks are SIMILAR to software libraries but ALSO implement a flow of control

* Frameworks order things like which messages re sent to objects, launch order, and when a user can touch a buttton

* ORDER IS PART OF THE FRAMEWORK
* The programmer says how to act (really it's the framework that says how to act - I think)

* The programmer adds specific functionality to the framework. She adds

     * content
     * controls
     * views

* DESIGN PATTERNS  behind the frameworks are what I need to understand.

* A really crucial design pattern to understand is the one for UIKIT

Study Notes: Frameworks Part 1



 
P 138/ Chapter 7

* IOS operating system for iPad (iPhone)

* Framework       Common code that provides generic functionality

·     IOS frameworks provide
o    Event handling support
o    Drawing support
o    Windows
o    Views
o    Controls

* Are the IOS frameworks the same as Cocoa?



Cocoa (API)
Snip from
From Wikipedia, the free encyclopedia

Cocoa
Website
Cocoa is one of Apple Inc.'s native object-oriented application programming interfaces (APIs) for the Mac OS X operating system and—along with the Cocoa Touch extension for gesture recognition and animation—for applications of iOS on Apple's iPhone, iPad, and iPod touch product lines.
Cocoa applications are typically developed using the development tools provided by Apple, specifically Xcode (formerly Project Builder) and Interface Builder, using the Objective-C language. However, the Cocoa programming environment can be accessed using other tools, such as Clozure CL, LispWorks, Object Pascal, Python, Perl, Ruby, and AppleScript with the aid of…..

What is Cocoa Touch

Snip from
http://developer.apple.com/technologies/ios/cocoa-touch.html

The Cocoa Touch frameworks that drive iOS apps share many proven patterns found on the Mac, but were built with a special focus on touch-based interfaces and optimization. UIKit provides the basic tools you need to implement graphical, event-driven applications in iOS. UIKit builds on the same Foundation framework infrastructure found on the Mac OS X, including file handling, networking, string building, and more.

Study Terms: Interface Builder

Am currently working with the Neil Goldstein/Tony Bove book iPad Application Development for Dummies, Version 2. Some ideas to reinforce from today's reading.

(page 101)


* The View Controller Window is the table of contents for the nib file. It represents an instance of each object. Also it always contains two proxy objects.

Proxy Objects

What is a proxy object? I know that a proxy is a substitute for an object and that an objective-C class can be accessed through a proxy object. They are something I give directions to to assume control for me. I think that proxy objects create things on the fly as opposed to my hard-coding them. I'd like to increase my understanding of proxy objects, because I think it would help me to better understand some of the ways that the SDK works.

      * File's Owner
             * is the controller object
             * is responsible for contents of the nib file
             * (in this example) is the View Controller

      * First Responder
              * first entry in the apps dynamically constructed responder chain
              * is the object, with which, the user is currently interacting

(Regular) Objects (in book example p 101)

       * View
              an instance of the UIView class






Wednesday, May 25, 2011

Staying Tuned: Reflecting on Objective-C



I switched gears in my work on Objective-C, and stopped blogging because of that. I realized I needed to become more of an objective-oriented programmer in my thinking and stopped off to take a class in C++. Now I plan to return to my self-study of Objective-C.

I'll be working with some other books.

Stay Tuned.