Re: stumbling around with D2W
Re: stumbling around with D2W
- Subject: Re: stumbling around with D2W
- From: Jesse Tayler <email@hidden>
- Date: Thu, 15 Dec 2011 12:04:40 -0500
D2W can be a bit like a black box, but it's really quite simple and I can't imagine NOT using it, ever since I really understood it at a low enough level that I started to extend my designs around it.
D2W is fundamental. Deceptively simple really.
It's just freeze-dried logic.
It's basically just key/value pairs with some additional runtime logical 'rules' based on the current user context. This provides the scope by which that rule would fire the resulting value for they key in question.
So, you can ask for a key in different situations, your d2w context will return differing values depending on this logic and the state of the users context.
So, start by figuring the context of the logic for whatever key/value you want to set - you can make up your own keys and I strongly suggest making your own components smart about using less rules given your specific architectural needs.
You can write rules which override lower level rules by making them either more logically specific or by increasing the priority if the rules have the same logical scope.
If you want to just get the hang of it quick, write rules that change things you can see on the screen, like titles or display keys and refresh the page to see your results.
Once you see how setting the scope, like what entity, what page configuration or what property key your key/values are valid for, you'll have it down. There's not much else to it.
D2W is the most efficient way to program flexible custom logic and in the past, I've written whole sets of UI elements that need only a tiny additional hint from rules -- by reading eo model attributes and naming conventions along with the current context -- one can make a super-reliable and very simple app with 10x fewer rules than if you didn't create your own smart elements.
Embrace it and extend it to suit your specific needs and you won't need either tons of little rules or tons of java logic - a nice balance of the two is simple beauty!
enjoy!
On Dec 15, 2011, at 11:41 AM, Theodore Petrosky wrote:
> Is there an example out there? I feel totally lost, I don't understand where to begin.
>
> I hesitate asking for this kind of low level help.
>
> I feel like a fish out of water.
>
> Ted
>
> --- On Thu, 12/15/11, Ramsey Gurley <email@hidden> wrote:
>
>> From: Ramsey Gurley <email@hidden>
>> Subject: Re: stumbling around with D2W
>> To: "Theodore Petrosky" <email@hidden>
>> Cc: email@hidden
>> Date: Thursday, December 15, 2011, 10:28 AM
>> Hi Ted,
>>
>> componentName = ERD2WEditToOneRelationship
>> restrictedChoiceKey = object.currentTitles
>>
>> Then create a method on your object returning an array of
>> current employment titles like you have below.
>>
>> Ramsey
>>
>> On Dec 15, 2011, at 8:03 AM, Theodore Petrosky wrote:
>>
>>> OK so this is a real newbie thing.
>>>
>>> In my Wonder app, I would:
>>>
>>> create a list of entries to populate a popup
>>>
>>> employmentTitleList =
>> EmploymentTitle.fetchEmploymentTitles(newEmployeeEC,
>> EmploymentTitle.IS_CURRENT.eq(true),
>> EmploymentTitle.ORDERING_INT.ascs());
>>>
>>> I don't understand how to do this in an Edit page in
>> D2W.
>>>
>>> Is there anything like this in an example?
>>>
>>> Ted
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be
>> ignored.
>>> Webobjects-dev mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden