PC Review


Reply
Thread Tools Rate Thread

class factory pattern question

 
 
Craig Buchanan
Guest
Posts: n/a
 
      5th Apr 2004
I've seen design patterns for class factories that work well to create
(fetch) objects, but I haven't seen anything about how to persist the class'
data when it has changed. Is this done thru the factory? What about
security? I'm assuming that the factory should enforce security.

Has anyone seen examples of this?

Thanks,

Craig Buchanan


 
Reply With Quote
 
 
 
 
CJ Taylor
Guest
Posts: n/a
 
      5th Apr 2004
Can you give me an example of what you mean by persisting data when its
changed? As in notifying the underlying data storage? Or other objects
within the program that need to know when data is changed?

-CJ

"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:uOCLJ%(E-Mail Removed)...
> I've seen design patterns for class factories that work well to create
> (fetch) objects, but I haven't seen anything about how to persist the

class'
> data when it has changed. Is this done thru the factory? What about
> security? I'm assuming that the factory should enforce security.
>
> Has anyone seen examples of this?
>
> Thanks,
>
> Craig Buchanan
>
>



 
Reply With Quote
 
Craig Buchanan
Guest
Posts: n/a
 
      5th Apr 2004
CJ-

Thanks for the reply.

I was referring to persisting data in the database. It doesn't seem like
the factory should be doing this, but I could be wrong. Currently, I use
the base object's (named ObjectInfo) Save method to persist information. I
have a blob field that contains a serialized collection of properties for
its decendant's properties

Here's what I want to do:
* Build a factory that will create a new ObjectInfo instance or an
instance of one of its decendants.
* The factory will return a collection of ObjectInfos that match given
criteria and the security clearance of the user.

Thoughts?

Craig

"CJ Taylor" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Can you give me an example of what you mean by persisting data when its
> changed? As in notifying the underlying data storage? Or other objects
> within the program that need to know when data is changed?
>
> -CJ
>
> "Craig Buchanan" <(E-Mail Removed)> wrote in message
> news:uOCLJ%(E-Mail Removed)...
> > I've seen design patterns for class factories that work well to create
> > (fetch) objects, but I haven't seen anything about how to persist the

> class'
> > data when it has changed. Is this done thru the factory? What about
> > security? I'm assuming that the factory should enforce security.
> >
> > Has anyone seen examples of this?
> >
> > Thanks,
> >
> > Craig Buchanan
> >
> >

>
>



 
Reply With Quote
 
CJ Taylor
Guest
Posts: n/a
 
      5th Apr 2004
Craig,

That was going to be what I recommended was using the base object to do the
save. The factory isn't really responsible for that from what I remember
about the pattern, just the creation of the object with a common interface
(or base class) then the object itself took care of persistance, but that
was dealt with in the base class.

I suppose you could use the factory if you wanted to, but seems a little out
of the way you know? Unless you want the factory to deal with your BLOB
data.

But I don't know if thats necessarily needed.

HTH,
CJ

"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> CJ-
>
> Thanks for the reply.
>
> I was referring to persisting data in the database. It doesn't seem like
> the factory should be doing this, but I could be wrong. Currently, I use
> the base object's (named ObjectInfo) Save method to persist information.

I
> have a blob field that contains a serialized collection of properties for
> its decendant's properties
>
> Here's what I want to do:
> * Build a factory that will create a new ObjectInfo instance or an
> instance of one of its decendants.
> * The factory will return a collection of ObjectInfos that match given
> criteria and the security clearance of the user.
>
> Thoughts?
>
> Craig
>
> "CJ Taylor" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Can you give me an example of what you mean by persisting data when its
> > changed? As in notifying the underlying data storage? Or other objects
> > within the program that need to know when data is changed?
> >
> > -CJ
> >
> > "Craig Buchanan" <(E-Mail Removed)> wrote in message
> > news:uOCLJ%(E-Mail Removed)...
> > > I've seen design patterns for class factories that work well to create
> > > (fetch) objects, but I haven't seen anything about how to persist the

> > class'
> > > data when it has changed. Is this done thru the factory? What about
> > > security? I'm assuming that the factory should enforce security.
> > >
> > > Has anyone seen examples of this?
> > >
> > > Thanks,
> > >
> > > Craig Buchanan
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Joe Fallon
Guest
Posts: n/a
 
      6th Apr 2004
http://www.lhotka.net/ArticleIndex.a...ea=CSLA%20.NET

Check out Rocky's CSLA framework.
I am using it for a major project right now.
--
Joe Fallon



"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> CJ-
>
> Thanks for the reply.
>
> I was referring to persisting data in the database. It doesn't seem like
> the factory should be doing this, but I could be wrong. Currently, I use
> the base object's (named ObjectInfo) Save method to persist information.

I
> have a blob field that contains a serialized collection of properties for
> its decendant's properties
>
> Here's what I want to do:
> * Build a factory that will create a new ObjectInfo instance or an
> instance of one of its decendants.
> * The factory will return a collection of ObjectInfos that match given
> criteria and the security clearance of the user.
>
> Thoughts?
>
> Craig
>
> "CJ Taylor" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Can you give me an example of what you mean by persisting data when its
> > changed? As in notifying the underlying data storage? Or other objects
> > within the program that need to know when data is changed?
> >
> > -CJ
> >
> > "Craig Buchanan" <(E-Mail Removed)> wrote in message
> > news:uOCLJ%(E-Mail Removed)...
> > > I've seen design patterns for class factories that work well to create
> > > (fetch) objects, but I haven't seen anything about how to persist the

> > class'
> > > data when it has changed. Is this done thru the factory? What about
> > > security? I'm assuming that the factory should enforce security.
> > >
> > > Has anyone seen examples of this?
> > >
> > > Thanks,
> > >
> > > Craig Buchanan
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Factory pattern question! CSharper Microsoft C# .NET 5 8th Aug 2008 10:37 PM
About Factory Method and Abstract Factory (design pattern) Duy Lam Microsoft C# .NET 2 27th Nov 2007 02:55 PM
About Factory Method and Abstract Factory (design pattern) Duy Lam Microsoft Dot NET 0 14th Nov 2007 12:29 PM
Design Question for Factory Pattern and Casting Types =?Utf-8?B?R2FycmV0dEQ3OA==?= Microsoft VB .NET 6 15th May 2006 02:52 PM
Question regarding implentation of factory pattern with internal objects Carlo Razzeto Microsoft Dot NET Framework 1 1st Mar 2006 09:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.