473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

class factory pattern question

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
Nov 20 '05 #1
5 1607
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" <so*****@microsoft.com> wrote in message
news:uO****************@TK2MSFTNGP09.phx.gbl...
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

Nov 20 '05 #2
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" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
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" <so*****@microsoft.com> wrote in message
news:uO****************@TK2MSFTNGP09.phx.gbl...
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


Nov 20 '05 #3
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" <so*****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
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" <so*****@microsoft.com> wrote in message
news:uO****************@TK2MSFTNGP09.phx.gbl...
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



Nov 20 '05 #4
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" <so*****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
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" <so*****@microsoft.com> wrote in message
news:uO****************@TK2MSFTNGP09.phx.gbl...
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



Nov 20 '05 #5
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" <so*****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
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" <no****@blowgoats.com> wrote in message
news:10*************@corp.supernews.com...
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" <so*****@microsoft.com> wrote in message
news:uO****************@TK2MSFTNGP09.phx.gbl...
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



Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sebastien Degardin | last post by:
Hello, I need to use a Factory pattern to create services class. i have an interface --> MyService i can have an abstract class --> MyAbstractService i have several concrete class for this...
17
by: Medi Montaseri | last post by:
Hi, Given a collection of similar but not exact entities (or products) Toyota, Ford, Buick, etc; I am contemplating using the Abstraction pattern to provide a common interface to these products....
2
by: Simon | last post by:
Hi. I don't have a problem per se, I was just wondering if anyone can offer some opinions about the best way to go about creating and disposing of a Singleton class. I have a class (handling...
1
by: Mark McDonald | last post by:
This question kind of follows on from Mike Spass’ posting 10/11/2004; I don’t understand why you can’t declare an implicit operator to convert a base class to a derived class. The text...
8
by: Craig Buchanan | last post by:
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...
8
by: Jason MacKenzie | last post by:
Is there a way to prevent classes from being instantiated by methods other than my factory pattern? I have a couple of classes and want to force the factory class to be used as the "entry...
8
by: deko | last post by:
Which layer should a Factory class go in? DA - Data Access BL - Business Logic UI - User Interface ??
2
by: Duy Lam | last post by:
Hi everyone, Sorry, I don't know what group to post this problem, I think may be this group is suitable. I'm styduing DAO (Data Access Object) pattern in this link...
11
by: digz | last post by:
Hello, Apologies if this is the wrong group for this question. I want to design an interface , where for a custom functionality , the client writes a new class with the function implementation...
44
by: Steven D'Aprano | last post by:
I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Essentially, the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.