and now, back to cf8/mach ii related fun.
cf8, mach iiAlright, now that I have my little Flex app ironed out (it's working fine now. Whew) I'm back to playing with CF8 and Mach II
I want to setup something practical for me and the kids to keep track of things, like groceries they want me to buy, stuff I want them to do, etc.
My plan, then, is to take this modified user manager app and modify it to suit my needs.
The following are functions I want to put into this thing:
- Grocery list. This one's easy enough.
- Chores for the kids. Aha! This one'll make it fun. This will require dates, time to get it done, when it was done, by whom, etc.
- Track their homework. Since they underperformed this last school year, I want them to put in each day what homework they had, and when they finished. Yeh, it's micromanaging, and it'll be tedious, but they're smart freaking kids and need to do better. (plus, I'll have what they put in emailed to me.)
- There's gotta be at least a fourth functionality I can add. I'll figure something out.
Anyway, that's my home project for now.
*fingers crossed*
mach iiI THINK I successfully performed some basic object composition.
As per the usual Wiki-sources, Object Composition, I read what the definition of this concept was.
To wit, it isis a way and practice to combine simple objects or data types into more complex ones.
Ok, so that makes sense.
So, realizing that what I had was a 1-n relationship between users and recipes (1 user can have n number of recipes), I went about figuring out how to return recipes in my UserGateway.
Of course, it started with the m2 config file, and working my way up the latter.
I'm still testing this, so I probably jinxed myself all to hell posting about it before being 100% sure. I hope not. We'll see, now won't we?
breathless mach ii update: success!
mach iiok, so I was able to add a select element to be able to both show who was the default user (who's recipe it was), along with it being populated with all users.
Also, I had to be able to update the info.
Easy. I just had to add the notify-listener call that returned all of my users in an array in the showRecipeForm event-handler.
I then had to make sure that new table column, 'userid', was being selected, updated, and deleted in the DAO (not to mention the bean getter and setter)
Of course, I made sure things were kosher in the service layer, as well.
It's working fine, except that once it updates, it only returns the number of recipes on the showAllRecipes form, instead lf all. I believe that's just due to the bean still being in memory.
I may just have to clean things out once the info is submitted.
(what this means is, once my form is submitted, it calls my showAllRecipes method, which has userid as an optional argument. Since it's in memory still, or at least to my thinking that's the case, it's being returned by userid, and not all. When I refresh the page, it returns all recipes. I think I'll need a filter to be called before calling the show all method. I'll test it and see.)
Continuing adventures in Mach II
mach iiMy boss and coworker are gone for two days, so, along with some tasks I was given to take care of while they were gone, I was also tasked with getting to know Mach II, esp the service layer more.
so, I took a slightly modified version of Mr Shuck's User manager M2 app, and added a category of Recipes.
My challenge: tie the recipes to users.
So I added an innerjoin to the gateway; I then made sure that the recipe bean had a getter and setter for both the userid and username I was returning.
On my userform I now have a recipe array that I'm creating, and sure enough, it's there.
I'm still wondering , tho, if combining the userid and username to the recipe bean doesn't taint it somehow. I'm thinking that I should probably use the user bean ONLY, and reference that info along with the recipe bean.
More investigation to follow.
oh, ok. Slowly, but surely...
cf8, coding stuff in general, mach iiAlrighty, so far, here's what I know (I believe) about Mach II:
Listeners simply forward to the service layer.
Services contain logic to pull data via either DAOs or Gateways.
DAOs handle single records, and CRUD related work.
Gateways return multiple records, and/or more complex SQL.
Beans are simply instances of single records, with getter and setting methods for each attribute the object may have.
I'm working on fiddling with the service layer on this sample user manager app. I've added a table, 'recipes', and want to tie recipes to each individual user. This should be fairly straightforward.




Loading....