Sure enough, I setup a simple transfer xml for a non-existing object:
<object name="phantom" table="notReal">
<id name="ID" type="numeric" />
<property name="name" type="string" column="name" />
</object>
Then I used it, as such:
application.cs.getBean("transfer").new("phantom")
and it dumped out exactly what I would expect, a transfer object of type
phantom, and I could use setName("foo") without any problems. Sounds like
an interesting method of using transfer for transient-persistance, kinda
cool. Maybe you could even write a save() method on there, to commit it to
another data location other than the database? Might be a cool way of
wrapping up all different data locations in a standardized way. Cool stuff,
good idea =)
Chris Peterson
On Wed, Nov 19, 2008 at 3:42 AM, Mark Mandel <[EMAIL PROTECTED]> wrote:
>
> What happens if you create the objects with a table/columns that don't
> exist?
>
> As long as you don't save() or get(), you shouldn't get errors.
>
> Mark
>
> On Wed, Nov 19, 2008 at 6:48 PM, Jared Rypka-Hauer
> <[EMAIL PROTECTED]> wrote:
> >
> > No, this isn't something that Transfer does... it has to have the
> > database there to provide properties for the objects, so without a DB
> > table you have nothing to provide the object definition. I think it
> > would be sweet if Transfer's config would provide a way to configure
> > it with objects outside the DB model that you could simply retrieve
> > from the Transfer object... making it into an object factory as well
> > as a persistence engine.
> >
> > You might try creating an object tagset that doesn't have a DB table
> > and then calling new() against it, but I think that would fail when
> > Transfer tried to create the metadata for the object.
> >
> > Something to think about, anyway.
> >
> > J
> >
> > On Nov 18, 2008, at 10:15 PM, John K. wrote:
> >
> >>
> >> So I've encountered this problem a few times and each time I seem to
> >> stumble on figuring out how to best solve it. Sorry if this has been
> >> discussed here, I looked through pages and pages and did some searches
> >> but came up with nothing.
> >>
> >> The site I am designing has several objects (dogs, calendar events,
> >> ads, etc.). These all need to be created in the database, updated,
> >> etc. Perfect opportunity to use Transfer to make these database
> >> functions simple. I am able to set this up just fine and have
> >> incorporated validation into the works so that the data the user
> >> submits can be validated server side and returned to the form for
> >> corrections if necessary.
> >>
> >> My problem comes in when I start to work with things like a contact
> >> form. I really want all the functionality of a Transfer object,
> >> except I'll never have to interact with the database. I will just
> >> validate, return the user to the form to correct errors (invalid email
> >> address, missing info, etc.) if necessary and then once the submission
> >> is valid I'll send an email to the proper administrator.
> >>
> >> Has anyone used Transfer in this way? How so? Is it just as simple
> >> as mocking up and using the object but never saving the data? Have
> >> you come up with a better way to make this work? Maybe it's just late
> >> and this is as simple as it sounds.
> >>
> >> John
> >>
> >> >
> >
> >
> > >
> >
>
>
>
> --
> E: [EMAIL PROTECTED]
> W: www.compoundtheory.com
>
> >
>
--
Hey! I dont tell you how to tell me what to do, so dont tell me how to do
what you tell me to do! ~ Bender (Futurama)
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
You received this message because you are subscribed to the Google Groups
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---