3. Organize your thoughts…
•
Context: What is the problem you are trying to solve
•
Design: What do you understand about the existing
system
•
Impact: What moving parts do you think the change
you are making will affect
4. Deep Dive!
Explain :
•
What you are trying to accomplish
•
Moving parts that are impacted
•
your changes/ proposal (top down approach)
(+/-)
•
Parts that you don’t understand as you understand it.
5. Example: Content shows up in development mode but
does not in production mode.
•
Context: Want to be able to translate some service
data in the controllers before rendering a view.
•
Design: App, Service wrapper, Makara
•
Impact: Need to add the content into data that is fed
into res.render(view, data), so it will impact just the
rendering of that view.
•
Problem: Sometimes the content was missing when
page rendered…. and the problem was incorrect
handling of async.
6. iff you are curious …
//in the controller
server.get('/bar', function(req, res) {
async.waterfall([
function reqDataFromService(next) {
//.......
!
!
});
!
!
req.data = serviceData;
next();
!
!
},
function translateServiceData(next) {
mapContent('propFile', req);
next();
}
], function() {
//.....
res.render('barView', req.data);
});
function mapContent(file, req) {
//.......
!
//in the controller
server.get('/bar', function(req, res) {
async.waterfall([
function reqDataFromService(next) {
//.......
content.loadContentBundle(file, locale, function(err, bundle)
{
if (!err) {
var bundleRoot = bundle.get('foo');
req.data.bar = bundleRoot[req.data.bar];
}
!
});
!
!
req.data = serviceData;
next();
},
function translateServiceData(next) {
mapContent('propFile', req, function() {
next();
});
}
], function() {
//.....
res.render('barView', req.data);
});
function mapContent(file, req, cb) {
//.......
!
!
content.loadContentBundle(file, locale, function(err, bundle) {
if (!err) {
var bundleRoot = bundle.get('foo');
req.data.bar = bundleRoot[req.data.bar];
}
cb();
});
}
});
}
8. Rules of thumb
•
If you are asking: Say more
•
If you are answering: Ask more
•
If you are presenting: Simplify
9. Lost in translation ?
!
!
!
!
•
Best unifying language is the programming language
•
Share your code to demonstrate what you are trying to
do…. easy!!