473,396 Members | 1,834 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,396 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 1610
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.