Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5 and above, brought to you by Google, however the principles are sound and could be used for other frameworks too.
Writing factories and dependency injection logic by hand for every service and client can become tedious. Some other dependency injection frameworks even require you to explicitly map services to the places where you want them injected.
Check it out... exciting stuff
http://code.google.com/p/google-guice/
Idealism is what precedes experience; cynicism is what follows...
Showing posts with label Code Design. Show all posts
Showing posts with label Code Design. Show all posts
Wednesday, August 27, 2008
Sunday, May 11, 2008
EventHandlers / EventListeners : Where, inline or code ?
I admit it, I have a strong preference for declaring all event handlers/listeners in code. I believe it is better encapsulation, making for more scalable and more maintainable code. But this is a personal opinion.
Jesse Liberty's rules for examples...
Reading about Silverlight 2, I stumpled upon Jesse Liverty's rules for examples, they are simple and almost universal...
Judge for yourself...
1. Keep it simple enough that the example totally focuses on what you are trying to illustrate (but no simpler)
2. Try to use something like business objects rather than cute animals or game objects
3. Don’t show off how clever you are, break the code down into small digestible parts.
4. Use interim variables; they’re easier to catch in a debugger
5. Strip away all exception and error handling and bullet proofing unless you are teaching exception handling, error handling or bullet proofing.
6. Use great variable names so you need fewer comments, but don’t convince yourself that means you don’t need any.
7. Show the output
8. Make no apologies (except when you’re wrong)
Thanks, Jesse... for letting us laymen get access to some of the experience you have gained from writing those 10+ technical books about programming :)
Judge for yourself...
1. Keep it simple enough that the example totally focuses on what you are trying to illustrate (but no simpler)
2. Try to use something like business objects rather than cute animals or game objects
3. Don’t show off how clever you are, break the code down into small digestible parts.
4. Use interim variables; they’re easier to catch in a debugger
5. Strip away all exception and error handling and bullet proofing unless you are teaching exception handling, error handling or bullet proofing.
6. Use great variable names so you need fewer comments, but don’t convince yourself that means you don’t need any.
7. Show the output
8. Make no apologies (except when you’re wrong)
Thanks, Jesse... for letting us laymen get access to some of the experience you have gained from writing those 10+ technical books about programming :)
Labels:
Arbitrary Thoughts,
Best Practices,
Code Design
Subscribe to:
Posts (Atom)
Blog Archive
-
▼
2008
(123)
-
▼
August
(11)
- This blog have been moved...
- IDEFactory... currently in Beta… soon in production…
- RSL and the lack of a build-in map over class-defi...
- Adobe Flex training in a nutshell: Flex in a Week
- Guice (pronounced 'Juice')
- Curved Scrollbar
- .NET Reflector... no more Lutz Roeder
- ClassMappings between WebORB and Adobe Flex
- The other Adobe Flex ACE's in Europe
- I got my Adobe Community Expert (ACE) designation ...
- The MyLifeBits Project
-
▼
August
(11)
My Network
-
-
Stop dragging me into board meetings - Dear Reader : This might be a bit more NEGATIVE than you’re used to. Apologies about that. I love to chair startups and companies, but I hate 95% board m...11 years ago
-
Design practice makes perfect - Evidence gained from research is powerful. It can persuade the most stubborn board members if presented in a way where decisions can be made based on facts...12 years ago
-
-
dutch vs danish politics - First reaction: glad I don’t live there. And then I made this comparison. It doesn’t differ that much actually. CDA 14% – Konservative 10% VVD 21% – Venstr...16 years ago
-
The Next Web – Timothy Ferriss - First speaker on the last day of The Next Web was Timothy Ferriss, author of the ”4-Hour workweek”. I don’t know what I was really expecting from a guy who ...16 years ago
-
Links for Motorcycle enthusiasts - MC travel-blogs: Must see: http://www.kccd.no/ http://4qconditioning.blogspot.com/ Danish blogs: http://www.ossianbuilds.blogspot.com http://wrenchmonkees....16 years ago
-
New Arduino project - I found myself a new Arduino project – an automated car! Well how to go about this. My best approach was to get a cheap RC toy car from the local toy store...17 years ago
-
Unrecognized selector sent to instance - As you may or may not know, I do iPhone/Cocoa touch now... While playing around with something this evening I stumbled across something I thought I'd share...17 years ago
-
-
-
-
-
-
-
About Me
- Peter Andreas Molgaard
- Copenhagen, Denmark
Labels
- Adobe Flex (62)
- Events (28)
- Best Practices (27)
- ActionScript 3.0 (16)
- Adobe AIR (15)
- Tools (15)
- Workaholics United (14)
- PV3D (10)
- Arbitrary Thoughts (9)
- PureMVC (7)
- Adobe Flex SDK (6)
- Adobe Max (6)
- Methodology (6)
- RIA (6)
- State Machines (6)
- .NET (5)
- Adobe Flex Builder (5)
- DFUG (5)
- Google (5)
- WebORB (5)
- Data Visualization (4)
- Flash Platform (4)
- Independent Thinking (4)
- Process (4)
- SEO (4)
- Silverlight (4)
- Adobe Flash Player (3)
- Code Design (3)
- Flash Player (3)
- HCI (3)
- MAC vs. PC (3)
- Microsoft (3)
- Performance Optimization (3)
- Stockholm (3)
- Undocumentation (3)
- Visual Studio (3)
- Windows Workflow Foundation (3)
- ACE (2)
- AUG (2)
- Adobe Thermo (2)
- Ajax (2)
- Bug Report (2)
- Cairngorm (2)
- Commerciel (2)
- Documentation (2)
- Estimation (2)
- Firefox (2)
- Google Gears (2)
- London (2)
- Morphable Interfaces (2)
- SVN (2)
- SoftwareEngineering (2)
- Test (2)
- Admin (1)
- Adobe Flex Adobe Flex Builder (1)
- Facebook (1)
- Graphics (1)
- Hardware (1)
- HelloGroup (1)
- IEEE (1)
- Outsourcing (1)
- Training (1)
- XAML (1)