frameworks are bad, ok? - justin mcleancdn.classsoftware.com/.../frameworksarebad.pdf · •...

51
Frameworks Are Bad, OK? Justin Mclean Email: [email protected] Twitter: @justinmclean Blog: http://blog.classsoftware.com Tuesday, 12 April 2011

Upload: others

Post on 27-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Frameworks Are Bad, OK?Justin McleanEmail: [email protected]: @justinmcleanBlog: http://blog.classsoftware.com

Tuesday, 12 April 2011

Page 2: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Who am I?• Director of Class Software for almost 15 years

• Developing and creating web applications for 15 years

• Programming for 25 years

• Adobe certified developer and trainer in Flex and ColdFusion

• Adobe Community Champion

• Based in Sydney Australia

Tuesday, 12 April 2011

Page 3: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

What I’m Talking About• Not about specific frameworks

• “best” or “worst” framework to use

• What an expert?

• How your brain works

• General issues with frameworks

• How to write MVC without a framework

• How to get the best out of your framework

Tuesday, 12 April 2011

Page 4: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Pragmatic Thinking & Learning

Tuesday, 12 April 2011

Page 5: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Experience with Frameworks

• MVC frameworks for about 20 years

• Used Cairngorm, Mate, Swiz, PureMVC, Parsley frameworks in commercial projects.

• Flex Framework.

Tuesday, 12 April 2011

Page 6: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Frameworks are Bad• Hard to understand and use

• Hard to debug when things go wrong

• Used for the wrong reasons

• Used incorrectly

• Too abstract and generic

• Like to do things their own way

• Hinder learning and skill progression

Tuesday, 12 April 2011

Page 7: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

What does it take to be an Expert?

Tuesday, 12 April 2011

Page 8: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Dreyfus Model

• Novices

• Advanced Beginner

• Competent

• Proficient

• Expert

Tuesday, 12 April 2011

Page 9: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Novice

• Just want to get it done

• Confused when things don’t work

• Need rules or recipes

• No real understanding of context

Tuesday, 12 April 2011

Page 10: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Advanced Beginners

• Break away from rules a little

• Understand limited context

• Difficulty trouble shooting

Tuesday, 12 April 2011

Page 11: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Competent

• Conceptual models

• Can troubleshoot

• Can solve new problems

• Seek out and use advice

• May not know what to focus on when troubleshooting

Tuesday, 12 April 2011

Page 12: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Proficient

• Can reflect and change

• Learn from others experience

• Know when rules apply and don’t apply

• Experience teaches what to expect

Tuesday, 12 April 2011

Page 13: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Expert

• Source of knowledge

• Look for better ways and methods

• Large body of experience to draw upon

• Work from intuition not reason

• Can focus on what details are important and knows what can be ignored

• Frameworks will hinder

Tuesday, 12 April 2011

Page 14: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Unskilled and Unaware of it

• Most people think they are more skilled

• Second order incompetence

Tuesday, 12 April 2011

Page 15: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

The Bad News

• It takes 10000 hours to become a expert

• No shortcuts it’s hard work

• Constant learning and practise

• Applies to a single skill

Tuesday, 12 April 2011

Page 16: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

The Good News

• Less time to become an expert in something similar

• You can learn new things

Tuesday, 12 April 2011

Page 17: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Experts are Bad

• Most are not experts at teaching

• Can’t explain why they do things

Tuesday, 12 April 2011

Page 18: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

How Your Brain Works

Tuesday, 12 April 2011

Page 19: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Your Brain as a Computer

• Dual CPU

• 1st CPU linear and slow

• 2nd CPU muticore, asynchronous, fast

• Shared Bus

• DRAM memory

Tuesday, 12 April 2011

Page 20: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

R CPUR CPU

R CPUCPU 1 CPU 2

Memory

Bus

I0 Hz I0 MHz

Your Brain

Tuesday, 12 April 2011

Page 21: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

L Mode Thinking

• Processes language

• Linear and logical

• Step by step

• Slow

• Keeps track of time

Tuesday, 12 April 2011

Page 22: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

R Mode Thinking

• Pattern matching searches

• Can run in the background

• Used for intuition, problem solving and creativity

• Stores everything (but not indexed)

• Non rational

Tuesday, 12 April 2011

Page 23: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Bus and Memory

• Shared bus only one CPU can use at a time

• Memory must be refreshed

• Reads is also a write

Tuesday, 12 April 2011

Page 24: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Why R Mode is Important

• Writing code is more art than science

• Fast

• Provides intuition

• Vital for problem solving

• If not using you only using half your brain power

Tuesday, 12 April 2011

Page 25: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

The Trouble With Frameworks

Tuesday, 12 April 2011

Page 26: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

What’s Good

• Can development time on large projects

• Reduce dependancies between parts of code

• Written by smart people

• Solves know problems

Tuesday, 12 April 2011

Page 27: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Which Framework?

• Which one should you use?

• New ones all the time

• Frameworks have bugs!

Tuesday, 12 April 2011

Page 28: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Context is King

• “Best” framework to use:

• Depends on you teams skill

• Depends on the project

Tuesday, 12 April 2011

Page 29: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Knowledge vs Time

0

25

50

75

100

1 2 3 4 5 6 7 8 9 10

Tuesday, 12 April 2011

Page 30: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Framework Misuse

• Shallow design and no architecture

• Copy and paste coding

Tuesday, 12 April 2011

Page 31: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Framework Use

• Hard to understand

• Can be inflexible

• Hard to debug

Tuesday, 12 April 2011

Page 32: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Flex and Frameworks

• Do things their own way and ignore Flex

• Some frameworks are trying to solve other language issues

• May not support all needed Flex features

Tuesday, 12 April 2011

Page 33: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Model View Controller

• Most Flex framework are MVC

• Different MVC frameworks use view, model and controller slightly differently

• MVC is about 30 year old!

• Other styles of frameworks exist

• Most frameworks can be implemented via design patterns

Tuesday, 12 April 2011

Page 34: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Flex is a Framework

Tuesday, 12 April 2011

Page 35: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Simple MVC

• Structure

• Components

• Data binding

• Events

Tuesday, 12 April 2011

Page 36: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

It’s Coding Time (Finally)

Tuesday, 12 April 2011

Page 37: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Framework Recovery Program

Tuesday, 12 April 2011

Page 38: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

One Size Does Not Fit All

• Depends on your team

• Depends on your project

Tuesday, 12 April 2011

Page 39: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

There Can Only Be One

• Read up about different frameworks

• Learn more than one framework

• Consider Flex SDK and libraries

Tuesday, 12 April 2011

Page 40: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Still writing COBOL?

• Look into framework history and what problems it try to solve

• Does the framework suit Flex/AS?

Tuesday, 12 April 2011

Page 41: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Start Simple

• Consider using a simple framework

• You can go a long way with some structure components, data binding and events

• Later you can add libraries or convert to a “real” framework

Tuesday, 12 April 2011

Page 42: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Use Flex and AS!

• Use a framework that take advantage of Flex and AS features

• Do you really want to use a clone of a framework written for another language?

Tuesday, 12 April 2011

Page 43: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Use The Source

• Source code is a must!

• Easier to debug and understand what’s going on

• Frameworks and be good example of design patterns

Tuesday, 12 April 2011

Page 44: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Bend the Rules

• Treat a framework as guidelines

• Don’t fight the framework, if it’s not working change it

Tuesday, 12 April 2011

Page 45: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Solve the Right Problem

• Solve business problems not framework problems

• Bend the framework to you will!

• Don’t fight the framework

Tuesday, 12 April 2011

Page 46: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Architecture

• A framework is no substitute

Tuesday, 12 April 2011

Page 47: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Throw It Away

• Find a framework that can be removed or easily swapped

Tuesday, 12 April 2011

Page 48: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Not All Dependancy is Bad

• Reducing dependancy comes at a cost

• Complexity vs simplicity

Tuesday, 12 April 2011

Page 49: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Be Lazy

• Use code generation for

• Data model

• Common framework plumbing like messages or commands

Tuesday, 12 April 2011

Page 50: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

The Future of Frameworks

• Frameworks other than MVC

• Less general frameworks

• Advice on what frameworks are good for what teams and projects

• Better debugging support

Tuesday, 12 April 2011

Page 51: Frameworks Are Bad, OK? - Justin Mcleancdn.classsoftware.com/.../FrameworksAreBad.pdf · • Developing and creating web applications for 15 years • Programming for 25 years •

Questions?

Ask now, see me after the session,follow me on twitter @justinmcleanor email me at [email protected].

Code and slides can be found athttp://blog.classsoftware.com

Tuesday, 12 April 2011