Tag Archives: java

Dependecy Injection on J2ME/CLDC devices.

This post is a little geeky and technical and product-related for AgileAdvice, and is a shameless self-promotion. Nevertheless, since testability, test-driven-development, and incremental design are non-exclusive sub-topics of Agile, I though I’d report this here anyway.

Many developers use the Dependency Injection and Inversion of Control (IoC) patterns through such IoC containers as Spring, Hivemind, Picocontainer, and others. They have all sorts of benefits to testability, flexibility, etc. that I won’t repeat here, but can be read about here, here, and here. A great summary of the history of “IoC” can be found here. J2ME developers, however, especially those on limited devices that use the CLDC configuration of J2ME, cannot use the substantial number of IoC/DI containers out there, because they nearly all rely on reflection. These also often make use of APIs not present in the CLDC – APIs which could not easily be added. Lastly there’s a tendency among developers of “embedded software” to be very suspicious of complexity.

In working out some examples of DI as part of a testability workshop at one of my clients, I whipped up a quick DI container, and being the freak that I am, hardened it until it was suitable for production, because I hate half-finished products. So allow me to introduce the Israfil Micro Container. (That is, the Container from the Israfil Micro project). As I mention in the docs, “FemtoContainer” just was too ridiculous, and this container is smaller than pico-container. The project is BSD licensed, and hosted on googlecode, so source is freely available and there’s an issue/feature tracker, yadda yadda.

Essentially I believe that people working on cellphones and set-top boxes shouldn’t be constrained out of some basic software design approaches – you just have to bend the design approach to fit the environment. So hopefully this is of use to more than one of my clients. It currently supports an auto-wiring registration, delayed object creation (until first need), and forthcoming are some basic lifecycle support, and a few other nicities. It does not use reflection (you use a little adapter for object creation instead), and performs quicker than pico-container. Low, low overhead. It’s also less than 10 classes and interfaces (including the two classes in the util project). It’s built with Maven2, so you can use it in any Maven2-built project with ease, but of course you can always also just download the jar (and the required util jar too). Enjoy…

P.S. There are a few other bits on googlecode that I’m working on in the micro-zone. Some minimalist backports of some of java.lang.concurrency (just the locks), as well as some of the java.util.Collections stuff. Not finished, but also part of the googlecode project.


Affiliated Promotions:

Try our automated online Scrum coach: Scrum Insight - free scores and basic advice, upgrade to get in-depth insight for your team. It takes between 8 and 11 minutes for each team member to fill in the survey, and your results are available immediately. Try it in your next retrospective.

Please share!
Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail
Berteig
Upcoming Courses
View Full Course Schedule
Certified Scrum Product Owner® (CSPO) [Virtual Learning]
Online
C$1795.00
Jan 19
2021
Details
Kanban System Design® (KMP I) [Virtual Learning]
Online
C$1795.00
Jan 21
2021
Details
The Myth of Self-Organizing Teams - Lunch Session
Online
C$0.00
Jan 21
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1595.00
Jan 26
2021
Details
Seven Design Thinking Tips for Product Owners - Lunch Session
Online
C$0.00
Feb 2
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1595.00
Feb 8
2021
Details
Team Kanban Practitioner® (TKP) [Virtual Learning]
Online
C$1195.00
Feb 10
2021
Details
Certified Scrum Product Owner® (CSPO) [Virtual Learning]
Online
C$1795.00
Feb 11
2021
Details
Banking on Kanban - Kanban in the Financial Sector
Online - Instructor Led
C$149.00
Feb 11
2021
Details
Kanban System Design® (KMP I) [Virtual Learning]
Online
C$1525.75
Feb 17
2021
Details
Advanced Certified ScrumMaster® (A-CSM) [Virtual Learning]
Online
C$1440.75
Feb 17
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1355.75
Feb 23
2021
Details
Dealing with Slackers, Idiots and Subversives in Agile Teams - Lunch Session
Online
C$0.00
Feb 23
2021
Details
Deadlines Are Dead To Me - Dealing with Deadlines in Agile Teams
Online - Instructor Led
C$149.00
Feb 23
2021
Details
Kanban Systems Improvement® (KMP II) [Virtual Learning]
Online
C$1525.75
Feb 25
2021
Details
Master Kanban for Scrum - Kanban for Scrum Masters
Online - Instructor Led
C$149.00
Feb 25
2021
Details
Stop the BS Metrics! Performance Reviews in Agile Teams - Lunch Session
Online
C$0.00
Mar 2
2021
Details
Kanban Your Projects - Kanban for Project Managers
Online - Instructor Led
C$128.14
Mar 4
2021
Details
Advanced Certified Scrum Product Owner® (A-CSPO) [Virtual Learning}
Online
C$1440.75
Mar 9
2021
Details
Leave Us Alone! - Dealing with Urgent Interruptions in Agile Teams
Online - Instructor Led
C$126.65
Mar 9
2021
Details
Team Kanban Practitioner® (TKP) [Virtual Learning]
Online
C$1015.75
Mar 10
2021
Details
Banking on Kanban - Kanban in the Financial Sector
Online - Instructor Led
C$126.65
Mar 10
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1355.75
Mar 22
2021
Details
Certified Scrum Product Owner® (CSPO) [Virtual Learning]
Online
C$1525.75
Mar 25
2021
Details
What the Heck is Kanban? - Introduction to the Kanban Method
Online - Instructor Led
C$126.65
Mar 25
2021
Details
Deadlines Are Dead To Me - Dealing with Deadlines in Agile Teams
Online - Instructor Led
C$126.65
Mar 25
2021
Details
Kanban System Design® (KMP I) [Virtual Learning]
Online
C$1525.75
Mar 30
2021
Details
Advanced Certified ScrumMaster® (A-CSM) [Virtual Learning]
Online
C$1440.75
Mar 30
2021
Details
Kanban Your Projects - Kanban for Project Managers
Online - Instructor Led
C$126.65
Mar 31
2021
Details
Master Kanban for Scrum - Kanban for Scrum Masters
Online - Instructor Led
C$126.65
Apr 1
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1355.75
Apr 6
2021
Details
Banking on Kanban - Kanban in the Financial Sector
Online - Instructor Led
C$126.65
Apr 6
2021
Details
Leave Us Alone! - Dealing with Urgent Interruptions in Agile Teams
Online - Instructor Led
C$126.65
Apr 6
2021
Details
Team Kanban Practitioner® (TKP) [Virtual Learning]
Online
C$1015.75
Apr 8
2021
Details
Certified Scrum Product Owner® (CSPO) [Virtual Learning]
Online
C$1525.75
Apr 13
2021
Details
What the Heck is Kanban? - Introduction to the Kanban Method
Online - Instructor Led
C$126.65
Apr 15
2021
Details
Certified ScrumMaster® (CSM) [Virtual Learning]
Online
C$1355.75
Apr 21
2021
Details
Master Kanban for Scrum - Kanban for Scrum Masters
Online - Instructor Led
C$126.65
Apr 22
2021
Details
Deadlines Are Dead To Me - Dealing with Deadlines in Agile Teams
Online - Instructor Led
C$126.65
Apr 22
2021
Details
Advanced Certified Scrum Product Owner® (A-CSPO) [Virtual Learning]
Online
C$1440.75
Apr 27
2021
Details
Kanban Your Projects - Kanban for Project Managers
Online - Instructor Led
C$126.65
Apr 27
2021
Details
Advanced Certified ScrumMaster® (A-CSM) [Virtual Learning]
Online
C$1695.00
Apr 29
2021
Details
What the Heck is Kanban? - Introduction to the Kanban Method
Online - Instructor Led
C$126.65
May 6
2021
Details
Leave Us Alone! - Dealing with Urgent Interruptions in Agile Teams
Online - Instructor Led
C$126.65
May 6
2021
Details
Kanban Systems Improvement® (KMP II) [Virtual Learning]
Online
C$1525.75
Jun 1
2021
Details