.NETGURU
Manager Collection Class (MCC) Pattern
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-patterns' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

bryan costanich
This is a multi-part message in MIME format.

------_=_NextPart_001_01C17DC9.139216F8
Content-Type: multipart/alternative;
    boundary="----_=_NextPart_002_01C17DC9.139216F8"

------_=_NextPart_002_01C17DC9.139216F8
Content-Type: text/plain;
    charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

All,

=20

I have captured a pattern that many of you have probably come across or
used before. It is similar to the ECC pattern but is simpler to use and
is a little more .NET friendly

=20

=20

Attached is draft .1 of the document and I would appreciate feedback on
it.

=20

Thanks,

bryan costanich

=20

Attachment below since this list does not support attachments (if you
would like the original word doc file, e-mail me (Click here to reveal e-mail address)
and I will send it (12kb).:

=20

=20

Pattern Section

Description

Name

Manager Collection Class (MCC) [Plain English]

Aliases

=20

Abstract

An object design for data specific applications that follows the basic
model of ObjectManager, ObjectCollection, Object.

Problem

Architects and Developers face diverse application needs but need to
build consumable, maintainable code in the shortest amount of time
possible.

Pattern Type

Architecture/DesignPattern

Forces

* Encapsulation on re-use provides a high ROI when developing
applications because it's easier to consume, maintain, and less code
overall often needs to be developed.

* Object designs that are complex or bloated can be difficult
to understand, difficult to consume, and difficult to maintain.

Solution

Overview

Create an object model that follows the basic pattern of ObjectManager,
ObjectCollection, Object. The complete business entity is illustrated
below:

=20

The basic properties and methods are illustrated below and help to
further explain the relationship between the three objects:

=20

ObjectManager

The ObjectManager manages the repository object data and is used to
retrieve, persist, update, and delete an object or a collection of
objects. The ObjectManager represents the data store and includes the
code that access the data to create the business objects, although this
could be further abstracted from the ObjectManager class and put into an
ObjectDataManager class that handled the data acquisition and
persistence.

ObjectCollection

The ObjectCollection object inherits from the ArrayList .NET class
(although in a c++ implementation it could just as easily be a Vector)
which manages a collection of items and also implement IEnumerable which
enables it to be bound to list controls. The ObjectCollection class
adds an additional method to the ArrayList object that allows objects to
be sorted based on a property.

Object

The Object represents only the properties needed to maintain data upon a
particular object such as a User and is disconnected from the data
source completely. When data within the Object is changed, the Boolean
flag IsDirty is set to true. The object class does not know how to
"Save" or "Update" itself, instead it needs to be passed back to the
ObjectManager class for such functionality. Additionally, a collection
of objects, inside the ObjectCollection class could also passed back to
the ObjectManager class to get persisted in the data store.

Resulting Context

* Simple, easy to consume object model.

* Easily bindable to controls in .NET.

* Flexible architecture.

* Maintainability.

Rationale

* By applying the MCC pattern, solving design issues becomes
much simpler and therefore the solution can be reached more quickly
which in turn costs less.

* The MCC pattern provides a simple yet powerful way to model
real world problems in a manner that is easy to understand and use by a
wide array of developers.

* The simplicity of the MCC pattern provides a higher
probability that it will be understood and consumed, therefore a
consistent object model can be designed an adhered to in an application.

* With the MCC pattern, code is well encapsulated and can be
reused throughout the application. Furthermore, the ObjectCollection
class can easily be built to be reused across multiple projects.

Variants

Manager Collection ManagerClass

If the relationships are more complex than a single layer, for instance
if Users have Pets associated with them, then a Manager Collection
ManagerClass approach can be taken so that the User class also includes
the methods to update, retrieve, and delete Pets. Such an example might
go similar to the following:

* UserManager.GetUser()

* User.GetPet()

* User.UpdatePet(Pet)

One caveat however, is that in a web services scenario in order to
implement this pattern, another object on the Server would actually
implement those manager functions, however, that's another pattern and
is not in the scope of this.

Customized ObjectCollection

Although the MCC pattern calls for a generic ObjectCollection class that
can handle any object, the ObjectCollection class could be customized to
perform specific functions on a collection of classes. For example, if
the ObjectCollection class was implemented as UserCollection,
UserCollection.GetAverageAge() might be implemented.

Example

The classic business problem of users needing to be added, deleted, and
modified in a database is an example of where the MCC pattern can be
used. The basic model might look like the following:

=20

In order to retrieve a User, the static method UserManager.GetUser() is
called and a variety of information could be passed in.
UserManager.GetUser would then return a User object that matched the
information passed to the GetUser method. If the user object IsDirty
and needed to be updated, a call to the UserManager.UpdateUser() method
could be called, passing in the User object of the user to be updated.
If the user needed to be deleted, a call to UserManager.DeleteUser(),
with either the UserID or the User object passed in would do the job.

If a collection of users needed to be retrieved and displayed, then a
call to UserManager.GetUsers() would be called, and an ObjectCollection
of User objects would be returned. This collection could then be easily
bound to a list control and the proerties of each User could be
displayed appropriately. To update or remove the Users, the respective
UpdateUsers() and DeleteUsers() methods could be called on the
UserManager class.

Code Example

Object Code

(to be inserted later)

Databinding

<asp:DataGrid ID=3D"dtgDataGrid1" Runat=3D"server"
AutoGenerateColumns=3D"False">

<Columns>

<asp:BoundColumn DataField=3D"property1"
HeaderText=3D"Property 1"/>

<asp:BoundColumn DataField=3D"property2"
HeaderText=3D"Property 2"/>

</Columns>

</asp:DataGrid>

Related Patterns

Engine Collection Class (ECC)

The ECC pattern is very powerful similar pattern that is slightly more
complex and offloads a lot of responsibility of the manager class into
the collection class.

Known Uses

This pattern finds itself extremely useful in the context of .NET
because of it's ability to return a bindable collection of objects to
web controls.

Version Number

.1 - Draft Version

Revision History

December 5, 2001 - Pattern Captured, Bryan Costanich.

Retirement/Refresh Information

This pattern should be refreshed once the .NET final release is out.
Additionally, when major new technology paradigms are released such as
J2EE or .NET, then this patter should be evaluated for applicability and
retirement or refreshment might be in order.

Keywords

Design Pattern, Architecture Pattern, MCC, .NET, Enterprise, Components,
Object Model

=20

=20

------_=_NextPart_002_01C17DC9.139216F8
Content-Type: text/html;
    charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">

<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
/* Font Definitions */
@font-face
    {font-family:"Arial Narrow";
    panose-1:2 11 5 6 2 2 2 3 2 4;}
@font-face
    {font-family:"Century Schoolbook";
    panose-1:2 4 6 4 5 5 5 2 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0in;
    margin-bottom:.0001pt;
    font-size:12.0pt;
    font-family:"Times New Roman";}
a:link, span.MsoHyperlink
    {color:blue;
    text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
    {color:purple;
    text-decoration:underline;}
span.EmailStyle17
    {font-family:Arial;
    color:windowtext;}
p.Body-noindent, li.Body-noindent, div.Body-noindent
    {margin-top:0in;
    margin-right:-.7pt;
    margin-bottom:6.0pt;
    margin-left:0in;
    line-height:14.0pt;
    font-size:9.5pt;
    font-family:Arial;}
p.Picture2Med, li.Picture2Med, div.Picture2Med
    {margin-top:6.0pt;
    margin-right:0in;
    margin-bottom:6.0pt;
    margin-left:.25in;
    page-break-after:avoid;
    font-size:10.0pt;
    font-family:"Century Schoolbook";}
p.TableBody2, li.TableBody2, div.TableBody2
    {margin-top:2.0pt;
    margin-right:5.75pt;
    margin-bottom:2.0pt;
    margin-left:0in;
    line-height:12.5pt;
    font-size:8.5pt;
    font-family:Arial;}
p.TableBold2, li.TableBold2, div.TableBold2
    {margin-top:0in;
    margin-right:5.75pt;
    margin-bottom:3.0pt;
    margin-left:1.2pt;
    line-height:14.0pt;
    font-size:9.5pt;
    font-family:"Arial Narrow";
    font-weight:bold;}
p.TableBullet1, li.TableBullet1, div.TableBullet1
    {margin-top:2.0pt;
    margin-right:5.75pt;
    margin-bottom:0in;
    margin-left:.25in;
    margin-bottom:.0001pt;
    text-indent:-.25in;
    line-height:12.5pt;
    font-size:8.5pt;
    font-family:Arial;}
p.TableHead, li.TableHead, div.TableHead
    {margin-top:0in;
    margin-right:0in;
    margin-bottom:3.0pt;
    margin-left:0in;
    line-height:14.0pt;
    font-size:9.5pt;
    font-family:"Arial Narrow";
    font-weight:bold;}
@page Section1
    {size:8.5in 11.0in;
    margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
    {page:Section1;}
/* List Definitions */
ol
    {margin-bottom:0in;}
ul
    {margin-bottom:0in;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>All,</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>I have captured a pattern =
that many
of you have probably come across or used before.  It is similar to =
the ECC
pattern but is simpler to use and is a little more .NET =
friendly</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Attached is draft .1 of the =
document
and I would appreciate feedback on it.</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>Thanks,</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'>bryan</span></font><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'> =
costanich</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<div style=3D'border:none;border-bottom:solid windowtext =
1.0pt;padding:0in 0in 1.0pt 0in'>

<p class=3DMsoNormal =
style=3D'text-autospace:none;border:none;padding:0in'><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Attachment
below since this list does not support attachments (if you would like =
the
original word doc file, e-mail me (<a =
href=3D"mailto:Click here to reveal e-mail address">Click here to reveal e-mail address</a>)
and I will send it (12kb).:</span></font></p>

</div>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3DArial><span
style=3D'font-size:10.0pt;font-family:Arial'> </span></font></p>

<table class=3DMsoTableGrid border=3D1 cellspacing=3D0 cellpadding=3D0
style=3D'border-collapse:collapse;border:none'>
<tr>
<td width=3D127 valign=3Dtop bgcolor=3Dblack =
style=3D'width:95.4pt;border:solid windowtext 1.0pt;
background:black;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableHead><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Pattern Section</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop bgcolor=3Dblack =
style=3D'width:347.4pt;border:solid windowtext 1.0pt;
border-left:none;background:black;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableHead><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Description</span></font></b></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Name</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Manager
Collection Class (MCC) [Plain English]</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Aliases</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'> </span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Abstract</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>An
object design for data specific applications that follows the basic =
model of ObjectManager,
ObjectCollection, Object.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Problem</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Architects
and Developers face diverse application needs but need to build =
consumable,
maintainable code in the shortest amount of time =
possible.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Pattern Type</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Architecture/DesignPattern</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Forces</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Encapsulation on re-use provides a high =
ROI when
developing applications because it’s easier to consume, =
maintain, and
less code overall often needs to be developed.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Object designs that are complex or bloated =
can be
difficult to understand, difficult to consume, and difficult to =
maintain.</p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Solution</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Overview</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Create
an object model that follows the basic pattern of ObjectManager, =
ObjectCollection,
Object.  The complete business entity is illustrated =
below:</span></font></p>
<p class=3DPicture2Med><font size=3D2 face=3D"Century =
Schoolbook"><span
style=3D'font-size:10.0pt'><img border=3D0 width=3D269 height=3D195
src=3D"cid:image001.gif@01C17D86.05102B80"></span></font></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
basic properties and methods are illustrated below and help to further
explain the relationship between the three objects:</span></font></p>
<p class=3DPicture2Med><font size=3D2 face=3D"Century =
Schoolbook"><span
style=3D'font-size:10.0pt'><img border=3D0 width=3D413 height=3D109
src=3D"cid:image002.gif@01C17D86.05102B80"></span></font></p>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>ObjectManager</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
ObjectManager manages the repository object data and is used to =
retrieve,
persist, update, and delete an object or a collection of =
objects.  The ObjectManager
represents the data store and includes the code that access the data =
to
create the business objects, although this could be further abstracted =
from
the ObjectManager class and put into an ObjectDataManager class that =
handled
the data acquisition and persistence.</span></font></p>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>ObjectCollection</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
ObjectCollection object inherits from the ArrayList .NET class =
(although in a
c++ implementation it could just as easily be a Vector) which manages =
a
collection of items and also implement IEnumerable which enables it to =
be
bound to list controls.  The ObjectCollection class adds an =
additional method
to the ArrayList object that allows objects to be sorted based on a =
property.</span></font></p>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Object</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
Object represents only the properties needed to maintain data upon a
particular object such as a User and is disconnected from the data =
source
completely.  When data within the Object is changed, the Boolean =
flag IsDirty
is set to true.  The object class does not know how to =
“Save” or
“Update” itself, instead it needs to be passed back to the =
ObjectManager
class for such functionality.  Additionally, a collection of =
objects, inside the
ObjectCollection class could also passed back to the ObjectManager =
class to
get persisted in the data store.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Resulting Context</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Simple, easy to consume object model.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Easily bindable to controls in .NET.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Flexible architecture.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>Maintainability.</p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Rationale</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>By applying the MCC pattern, solving =
design
issues becomes much simpler and therefore the solution can be reached =
more
quickly which in turn costs less.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>The MCC pattern provides a simple yet =
powerful
way to model real world problems in a manner that is easy to =
understand and
use by a wide array of developers.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>The simplicity of the MCC pattern provides =
a
higher probability that it will be understood and consumed, therefore =
a
consistent object model can be designed an adhered to in an =
application.</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>With the MCC pattern, code is well =
encapsulated
and can be reused throughout the application.  Furthermore, the =
ObjectCollection
class can easily be built to be reused across multiple projects.</p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Variants</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Manager Collection =
ManagerClass</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>If
the relationships are more complex than a single layer, for instance =
if Users
have Pets associated with them, then a Manager Collection ManagerClass
approach can be taken so that the User class also includes the methods =
to
update, retrieve, and delete Pets.  Such an example might go =
similar to the
following:</span></font></p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>UserManager.GetUser()</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>User.GetPet()</p>
<p class=3DTableBullet1><font size=3D1 face=3DSymbol><span =
style=3D'font-size:8.5pt;
font-family:Symbol'>·<font size=3D1 face=3D"Times New =
Roman"><span
style=3D'font:7.0pt "Times New =
Roman"'>         
</span></font></span></font>User.UpdatePet(Pet)</p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>One
caveat however, is that in a web services scenario in order to =
implement this
pattern, another object on the Server would actually implement those =
manager
functions, however, that’s another pattern and is not in the =
scope of
this.</span></font></p>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Customized ObjectCollection</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Although
the MCC pattern calls for a generic ObjectCollection class that can =
handle
any object, the ObjectCollection class could be customized to perform
specific functions on a collection of classes.  For example, if =
the ObjectCollection
class was implemented as UserCollection, =
UserCollection.GetAverageAge() might
be implemented.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Example</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
classic business problem of users needing to be added, deleted, and =
modified
in a database is an example of where the MCC pattern can be =
used.  The basic
model might look like the following:</span></font></p>
<p class=3DPicture2Med><font size=3D2 face=3D"Century =
Schoolbook"><span
style=3D'font-size:10.0pt'><img border=3D0 width=3D91 height=3D157
src=3D"cid:image003.gif@01C17D86.05102B80"></span></font></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>In order
to retrieve a User, the static method UserManager.GetUser() is called =
and a
variety of information could be passed in.  UserManager.GetUser =
would then
return a User object that matched the information passed to the =
GetUser
method.  If the user object IsDirty and needed to be updated, a =
call to the UserManager.UpdateUser()
method could be called, passing in the User object of the user to be
updated.  If the user needed to be deleted, a call to =
UserManager.DeleteUser(),
with either the UserID or the User object passed in would do the =
job.</span></font></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>If
a collection of users needed to be retrieved and displayed, then a =
call to UserManager.GetUsers()
would be called, and an ObjectCollection of User objects would be =
returned. 
This collection could then be easily bound to a list control and the =
proerties
of each User could be displayed appropriately.  To update or =
remove the
Users, the respective UpdateUsers() and DeleteUsers() methods could be =
called
on the UserManager class.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Code Example</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Object Code</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>(to
be inserted later)</span></font></p>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Databinding</span></font></b></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
style=3D'font-size:7.0pt'><asp:DataGrid =
ID=3D"dtgDataGrid1" Runat=3D"server"
AutoGenerateColumns=3D"False"></span></font></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
=
style=3D'font-size:7.0pt'>        =
;        =
<Columns></span></font></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
=
style=3D'font-size:7.0pt'>        =
;            =
            =
<asp:BoundColumn DataField=3D"property1"
HeaderText=3D"Property 1"/></span></font></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
=
style=3D'font-size:7.0pt'>        =
;            =
            =
<asp:BoundColumn DataField=3D"property2"
HeaderText=3D"Property 2"/></span></font></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
=
style=3D'font-size:7.0pt'>        =
;        =
</Columns></span></font></p>
<p class=3DTableBody2 style=3D'line-height:normal'><font size=3D1 =
face=3DArial><span
style=3D'font-size:7.0pt'></asp:DataGrid></span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Related Patterns</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><b><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt;
font-weight:bold'>Engine Collection Class (ECC)</span></font></b></p>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>The
ECC pattern is very powerful similar pattern that is slightly more =
complex
and offloads a lot of responsibility of the manager class into the =
collection
class.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Known Uses</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>This
pattern finds itself extremely useful in the context of .NET because =
of it’s
ability to return a bindable collection of objects to web =
controls.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Version Number</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>.1
– Draft Version</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Revision History</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>December
5, 2001</span></font> – Pattern Captured, Bryan Costanich.</p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Retirement/Refresh =
Information</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>This
pattern should be refreshed once the .NET final release is out. 
Additionally, when major new technology paradigms are released such as =
J2EE
or .NET, then this patter should be evaluated for applicability and
retirement or refreshment might be in order.</span></font></p>
</td>
</tr>
<tr>
<td width=3D127 valign=3Dtop style=3D'width:95.4pt;border:solid =
windowtext 1.0pt;
border-top:none;padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBold2><b><font size=3D2 face=3D"Arial Narrow"><span
style=3D'font-size:9.5pt'>Keywords</span></font></b></p>
</td>
<td width=3D463 valign=3Dtop =
style=3D'width:347.4pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid =
windowtext 1.0pt;
padding:0in 5.4pt 0in 5.4pt'>
<p class=3DTableBody2><font size=3D1 face=3DArial><span =
style=3D'font-size:8.5pt'>Design
Pattern, Architecture Pattern, MCC, .NET, </span></font>Enterprise,
Components, Object Model</p>
</td>
</tr>
</table>

<p class=3DBody-noindent><font size=3D2 face=3DArial> </font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'> </span></font></p>

</div>

</body>

</html>
=00
------_=_NextPart_002_01C17DC9.139216F8--

------_=_NextPart_001_01C17DC9.139216F8
Content-Type: image/gif;
    name="image001.gif"
Content-Transfer-Encoding: base64
Content-ID: <image001.gif@01C17D86.05102B80>
Content-Description: image001.gif
Content-Location: image001.gif

R0lGODlhDQHDAHcAMSH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACH5BAEAAAAALAEAAQAM
AcIAhAAAAAAAAE1NTV5eXkVFRWhoaHx8fH5+fnBwcIyMjJqampaWlouLi729vaenp7Kysru7u7Oz
s6GhodDQ0MfHx9nZ2cvLy9LS0ubm5uHh4fDw8Onp6f///wECAwECAwECAwX/YCCOZGmeaKqubOue
QCzPdG3f96vvfO+jmKBwSCwaj8ikcslsDgEBnHR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//ra217dsa+7bpV8+977
Pg2Fhy7rt/374pM4+KN3ezSNz/zXi77ypPd886cv+K1AX/lfpr72dR4Pww9/++CHPfKvrxTM+iPw
4U+/S8e/+nmEtv2jIe7y1U//N7Nf9uLYbnaKwZ2EPqkdvtB69Td9/88Hf8zlXCi1UfkxXPCFfgP4
gKeWe4f0Ds1FJLxBfudHexC4gdHmCd7nDtuVgIPCgG3hgBx4glpxf7rHDellUKLSXnPVgBqIgjQI
JB4ofBKBXzBhgjVYgwWIf/0QYPk1gz3ogxJ4eOPEg0V4gj+4gho2f0tohCo4gVtGhFHIgU1IhdnG
e1eIhUf4fV1Ig8z2f1qIeFwYhg+YExjIX1aIhvWnhgaYYG3ohuoHh0AYYtlHhwOohuDReZCnhxD4
F2AIiHs4DINIiPQniH4ogIjYVRF2iI0YfoyBepijhJFIgKAHB4x4ib+UiWywiZyIXZ7ICMQXitw3
iixmitqna1dWiuyq6IiomIqv2HysSDygOIu9FosihouYqGzVhgG/+ImuyIvrh2H7pmffIG5LFwe3
SIwRODrxdgX6RiL+Vm/5hm/T6HJT4W9uEnCk6IzGt25Xd00T13BB8HARV47laHF9sHQax3EUBo63
t24jdwUtl3IC1HL3+EnDtHQyF3HfKI++R49A9wVHZ45GJwQHeZDaaFpL13RPF48C6XwIh3VXIHZB
d40MB3YYaSoXh3YYgHZq12ATCXdxh3QSWZKYF2p7J4wqaXu1eGzD+JKYpou7SJOuF5PBhpOfZ5Nv
x5PK5ZM+ApSmR4lGeQtEaTAhAAA7

------_=_NextPart_001_01C17DC9.139216F8
Content-Type: image/gif;
    name="image002.gif"
Content-Transfer-Encoding: base64
Content-ID: <image002.gif@01C17D86.05102B80>
Content-Description: image002.gif
Content-Location: image002.gif

R0lGODlhnQFtAHcAMSH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACH5BAEAAAAALAEAAQCc
AWwAhAAAAAAAAE1NTWhoaHx8fIyMjJqamrKysr29vaenp9nZ2dDQ0MfHx/Dw8OHh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/x0GMPv9SWsPvKTtGe/H4LuCjp2gvfO5xsHcnd9YoM3edSF1
wVv+8piHtMEjGmfWZb3r7Uhzsovy8PREfBzeqQ7F81N2vmf+9bCPvZ8/boaQN8Hprpe97nf/+pin
nffADz7Vfd9b4Rv/+C/PuRF4Xt8xMJ/kyI++9FPO4P+u8mJIX3qBcd0x3JN4+uAPf6utDkyRfB5Z
x/zwMjs8k5pMp/XfF7/85z/ptsM4nIg/tmOgIxb33N3bEPVa8Ud//wRYgH9GeApkeDJmC6jSFQ54
Gcn0eJC1Zf72dAZ4gRhYSg/FecElO+HSR7rDIBVnehqFegHSURVXV2ZngRnYggVIfFxge0jgfQrm
gjZIgDDILpV3gzwIfDmoXj0YhNGnfEXwfMtHBkZ4I0K4hMJHdAB2CM+zdHaxfVIIPWtUOrnHhFoY
e+RXbB6IfrujO7azfhEYdu43DyYDWCtIIVvYhlzoYtsWY/OmdftXh41lb3yRY7jFY5PFhm74h5eH
gEm2gLTQgOV0iFAGNBM4ZXGBbmcHiJC4dpuHcJ5nbCJwUZJURCMYF2yGRCfIO3FGRNDEaJFYikL3
g4jmUiKHhZRniieuaHOo6Cw7+Iq0GGyxiCuzWIu6KGw0lzO7+IvY9nfC2CTAWIzBFgIAOw==

------_=_NextPart_001_01C17DC9.139216F8
Content-Type: image/gif;
    name="image003.gif"
Content-Transfer-Encoding: base64
Content-ID: <image003.gif@01C17D86.05102B80>
Content-Description: image003.gif
Content-Location: image003.gif

R0lGODlhWwCdAHcAMSH+GlNvZnR3YXJlOiBNaWNyb3NvZnQgT2ZmaWNlACH5BAEAAAAALAEAAQBa
AJwAhAAAAAAAAE1NTXx8fGhoaIyMjJqamrKysqenp729vdDQ0MfHx9nZ2fDw8OHh4enp6f///wEC
AwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwECAwX/YCCOZGmeaKquJuC+
cPwGUG3feK7vfO/fAZkwRvsZj0hkcMgsJp/Q55IpdEavWN2USsx6v5AtdwYuR8VjgNX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PPPXMQ+wXAFdr
hkIMzdJJj/mSTHG8+5oM8yMc60tzwDZvjPO9MYc7s84yi4uthvb2auy8PA9bNHFHL70lUyS0O6ut
tZI2tdVVP3unslyvEAIAOw==

------_=_NextPart_001_01C17DC9.139216F8--

Reply to this message...
 
    
Mitch Denny (VIP)
Bryan,

I have this pattern :)

What you have formalised is a variation on the classic ECC
pattern that has come about by necessity more than anything
for .NET programmers.

Personally, I like yours, its clean, simple and straight
forward to implement. The doco looks good, but does need
some work. For example, spell out the parameters for the
Add, Delete, Update and Get methods on the manager.

Also consider dropping the "Object" suffix on them. That
would allow you to build a situation where you can inherit
from a base implementation of the design pattern.

Now ofcourse, how to you make a generic manager when it
should be talking to the data tier? Well, it sounds like
an opporunity to use delgates to me . . .

----------------------------------------
- Mitch Denny
- http://www.warbyte.com
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: bryan costanich [mailto:Click here to reveal e-mail address]
Sent: Thursday, 6 December 2001 7:12 AM
To: ngfx-patterns
Subject: [ngfx-patterns] Manager Collection Class (MCC) Pattern

All,

I have captured a pattern that many of you have probably come across or
used before. It is similar to the ECC pattern but is simpler to use and
is a little more .NET friendly

Attached is draft .1 of the document and I would appreciate feedback on
it.

Thanks,
bryan costanich

Attachment below since this list does not support attachments (if you
would like the original word doc file, e-mail me (Click here to reveal e-mail address)
and I will send it (12kb).:

Pattern SectionDescription
NameManager Collection Class (MCC) [Plain English]
Aliases
AbstractAn object design for data specific applications that follows the
basic model of ObjectManager, ObjectCollection, Object.
ProblemArchitects and Developers face diverse application needs but need
to build consumable, maintainable code in the shortest amount of time
possible.
Pattern TypeArchitecture/DesignPattern
Forces. Encapsulation on re-use provides a high ROI when
developing applications because it's easier to consume, maintain, and
less code overall often needs to be developed.
. Object designs that are complex or bloated can be difficult
to understand, difficult to consume, and difficult to maintain.
SolutionOverview
Create an object model that follows the basic pattern of ObjectManager,
ObjectCollection, Object. The complete business entity is illustrated
below:

The basic properties and methods are illustrated below and help to
further explain the relationship between the three objects:

ObjectManager
The ObjectManager manages the repository object data and is used to
retrieve, persist, update, and delete an object or a collection of
objects. The ObjectManager represents the data store and includes the
code that access the data to create the business objects, although this
could be further abstracted from the ObjectManager class and put into an
ObjectDataManager class that handled the data acquisition and
persistence.
ObjectCollection
The ObjectCollection object inherits from the ArrayList .NET class
(although in a c++ implementation it could just as easily be a Vector)
which manages a collection of items and also implement IEnumerable which
enables it to be bound to list controls. The ObjectCollection class
adds an additional method to the ArrayList object that allows objects to
be sorted based on a property.
Object
The Object represents only the properties needed to maintain data upon a
particular object such as a User and is disconnected from the data
source completely. When data within the Object is changed, the Boolean
flag IsDirty is set to true. The object class does not know how to
"Save" or "Update" itself, instead it needs to be passed back to the
ObjectManager class for such functionality. Additionally, a collection
of objects, inside the ObjectCollection class could also passed back to
the ObjectManager class to get persisted in the data store.
Resulting Context. Simple, easy to consume object model.
. Easily bindable to controls in .NET.
. Flexible architecture.
. Maintainability.
Rationale. By applying the MCC pattern, solving design issues
becomes much simpler and therefore the solution can be reached more
quickly which in turn costs less.
. The MCC pattern provides a simple yet powerful way to model
real world problems in a manner that is easy to understand and use by a
wide array of developers.
. The simplicity of the MCC pattern provides a higher
probability that it will be understood and consumed, therefore a
consistent object model can be designed an adhered to in an application.
. With the MCC pattern, code is well encapsulated and can be
reused throughout the application. Furthermore, the ObjectCollection
class can easily be built to be reused across multiple projects.
VariantsManager Collection ManagerClass
If the relationships are more complex than a single layer, for instance
if Users have Pets associated with them, then a Manager Collection
ManagerClass approach can be taken so that the User class also includes
the methods to update, retrieve, and delete Pets. Such an example might
go similar to the following:
. UserManager.GetUser()
. User.GetPet()
. User.UpdatePet(Pet)
One caveat however, is that in a web services scenario in order to
implement this pattern, another object on the Server would actually
implement those manager functions, however, that's another pattern and
is not in the scope of this.
Customized ObjectCollection
Although the MCC pattern calls for a generic ObjectCollection class that
can handle any object, the ObjectCollection class could be customized to
perform specific functions on a collection of classes. For example, if
the ObjectCollection class was implemented as UserCollection,
UserCollection.GetAverageAge() might be implemented.
ExampleThe classic business problem of users needing to be added,
deleted, and modified in a database is an example of where the MCC
pattern can be used. The basic model might look like the following:

In order to retrieve a User, the static method UserManager.GetUser() is
called and a variety of information could be passed in.
UserManager.GetUser would then return a User object that matched the
information passed to the GetUser method. If the user object IsDirty
and needed to be updated, a call to the UserManager.UpdateUser() method
could be called, passing in the User object of the user to be updated.
If the user needed to be deleted, a call to UserManager.DeleteUser(),
with either the UserID or the User object passed in would do the job.
If a collection of users needed to be retrieved and displayed, then a
call to UserManager.GetUsers() would be called, and an ObjectCollection
of User objects would be returned. This collection could then be easily
bound to a list control and the proerties of each User could be
displayed appropriately. To update or remove the Users, the respective
UpdateUsers() and DeleteUsers() methods could be called on the
UserManager class.
Code ExampleObject Code
(to be inserted later)
Databinding
<asp:DataGrid ID="dtgDataGrid1" Runat="server"
AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="property1"
HeaderText="Property 1"/>
<asp:BoundColumn DataField="property2"
HeaderText="Property 2"/>
</Columns>
</asp:DataGrid>
Related PatternsEngine Collection Class (ECC)
The ECC pattern is very powerful similar pattern that is slightly more
complex and offloads a lot of responsibility of the manager class into
the collection class.
Known UsesThis pattern finds itself extremely useful in the context of
.NET because of it's ability to return a bindable collection of objects
to web controls.
Version Number.1 - Draft Version
Revision HistoryDecember 5, 2001 - Pattern Captured, Bryan Costanich.
Retirement/Refresh InformationThis pattern should be refreshed once the
.NET final release is out. Additionally, when major new technology
paradigms are released such as J2EE or .NET, then this patter should be
evaluated for applicability and retirement or refreshment might be in
order.
KeywordsDesign Pattern, Architecture Pattern, MCC, .NET, Enterprise,
Components, Object Model

| [ngfx-patterns] member Click here to reveal e-mail address =OUR ID |
http://www.asplists.com/asplists/aspngbeta.asp =OIN/QUIT |
http://www.asplists.com/search =EARCH Archives | [ngfx-patterns] member
Click here to reveal e-mail address =OUR ID |
http://www.asplists.com/asplists/aspngbeta.asp =OIN/QUIT |
http://www.asplists.com/search =EARCH Archives

Reply to this message...
 
    
bryan costanich
Comments inline

-----Original Message-----
From: Mitch Denny [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, December 06, 2001 6:46 AM
To: ngfx-patterns
Subject: [ngfx-patterns] RE: Manager Collection Class (MCC) Pattern

Bryan,

I have this pattern :)
[bryan]
Yeah, I imagine you do, in fact, I imagine that everyone on this list
has at least SEEN this pattern before, I had just never run across it in
any formalized manner, except for the ECC, and I think that's pretty
different.
[/bryan]

What you have formalised is a variation on the classic ECC
pattern that has come about by necessity more than anything
for .NET programmers.
[bryan]
I'm not sure which ones a variation in which actually. I saw this
pattern a long time before I saw the ECC, it's just that I had never
seen this one formalized. I actually think the two patterns are
substantially different enough not use the term 'variation.' Actually,
in the pattern I put some variations on this one.

As far as necessity for .NET programming, yeah, I like this one a lot
because it fits so well with .NET, although I've actually seen this
implemented in WinDNA a lot. In fact, if I remember right, and I may
not be, Commerce Server 2000 implements something VERY similar to it.
[/bryan/

Personally, I like yours, its clean, simple and straight
forward to implement. The doco looks good, but does need
some work. For example, spell out the parameters for the
Add, Delete, Update and Get methods on the manager.
[bryan]
yeah, I like the simplicity of this one, I think that it's easier to use
because of that, and therefore more likely to be used. I work with a
lot of beginning programmers, and simplicity helps out in that arena.

On the doc, yeah I agree, it's a pretty sketchy draft, but I wanted to
get it out there. Also, my intention was to leave it pretty generic so
it could be used how people needed to, but spelling out the parameters
should definitely be there, at least as a guide for what could be
changed.
[/bryan]

Also consider dropping the "Object" suffix on them. That
would allow you to build a situation where you can inherit
from a base implementation of the design pattern.

[bryan]
yeah, that might not be a bad idea. I've also toyed with documenting it
as <ClassName>Manager, Collection, <ClassName> or something similar. I
want people to understand that it's good practice when using this
pattern to name it something like UserManager, ObjectCollection, User,
etc.
[/bryan]

Now ofcourse, how to you make a generic manager when it
should be talking to the data tier? Well, it sounds like
an opporunity to use delgates to me . . .
[bryan]
yeah, there are a lot of data abstraction patterns that deal
specifically with this that would work well in conjunction, so I stayed
away from it in this pattern.

Thanks for the comments!
[/bryan]

----------------------------------------
- Mitch Denny
- http://www.warbyte.com
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: bryan costanich [mailto:Click here to reveal e-mail address]=20
Sent: Thursday, 6 December 2001 7:12 AM
To: ngfx-patterns
Subject: [ngfx-patterns] Manager Collection Class (MCC) Pattern

All,

I have captured a pattern that many of you have probably come across or
used before. It is similar to the ECC pattern but is simpler to use and
is a little more .NET friendly

Attached is draft .1 of the document and I would appreciate feedback on
it.

Thanks,
bryan costanich

Attachment below since this list does not support attachments (if you
would like the original word doc file, e-mail me (Click here to reveal e-mail address)
and I will send it (12kb).:

Pattern SectionDescription
NameManager Collection Class (MCC) [Plain English]
Aliases
AbstractAn object design for data specific applications that follows the
basic model of ObjectManager, ObjectCollection, Object.
ProblemArchitects and Developers face diverse application needs but need
to build consumable, maintainable code in the shortest amount of time
possible.
Pattern TypeArchitecture/DesignPattern
Forces. Encapsulation on re-use provides a high ROI when
developing applications because it's easier to consume, maintain, and
less code overall often needs to be developed.
. Object designs that are complex or bloated can be difficult
to understand, difficult to consume, and difficult to maintain.
SolutionOverview
Create an object model that follows the basic pattern of ObjectManager,
ObjectCollection, Object. The complete business entity is illustrated
below:

The basic properties and methods are illustrated below and help to
further explain the relationship between the three objects:

ObjectManager
The ObjectManager manages the repository object data and is used to
retrieve, persist, update, and delete an object or a collection of
objects. The ObjectManager represents the data store and includes the
code that access the data to create the business objects, although this
could be further abstracted from the ObjectManager class and put into an
ObjectDataManager class that handled the data acquisition and
persistence.
ObjectCollection
The ObjectCollection object inherits from the ArrayList .NET class
(although in a c++ implementation it could just as easily be a Vector)
which manages a collection of items and also implement IEnumerable which
enables it to be bound to list controls. The ObjectCollection class
adds an additional method to the ArrayList object that allows objects to
be sorted based on a property.
Object
The Object represents only the properties needed to maintain data upon a
particular object such as a User and is disconnected from the data
source completely. When data within the Object is changed, the Boolean
flag IsDirty is set to true. The object class does not know how to
"Save" or "Update" itself, instead it needs to be passed back to the
ObjectManager class for such functionality. Additionally, a collection
of objects, inside the ObjectCollection class could also passed back to
the ObjectManager class to get persisted in the data store.
Resulting Context. Simple, easy to consume object model.
. Easily bindable to controls in .NET.
. Flexible architecture.
. Maintainability.
Rationale. By applying the MCC pattern, solving design issues
becomes much simpler and therefore the solution can be reached more
quickly which in turn costs less.
. The MCC pattern provides a simple yet powerful way to model
real world problems in a manner that is easy to understand and use by a
wide array of developers.
. The simplicity of the MCC pattern provides a higher
probability that it will be understood and consumed, therefore a
consistent object model can be designed an adhered to in an application.
. With the MCC pattern, code is well encapsulated and can be
reused throughout the application. Furthermore, the ObjectCollection
class can easily be built to be reused across multiple projects.
VariantsManager Collection ManagerClass
If the relationships are more complex than a single layer, for instance
if Users have Pets associated with them, then a Manager Collection
ManagerClass approach can be taken so that the User class also includes
the methods to update, retrieve, and delete Pets. Such an example might
go similar to the following:
. UserManager.GetUser()
. User.GetPet()
. User.UpdatePet(Pet)
One caveat however, is that in a web services scenario in order to
implement this pattern, another object on the Server would actually
implement those manager functions, however, that's another pattern and
is not in the scope of this.
Customized ObjectCollection
Although the MCC pattern calls for a generic ObjectCollection class that
can handle any object, the ObjectCollection class could be customized to
perform specific functions on a collection of classes. For example, if
the ObjectCollection class was implemented as UserCollection,
UserCollection.GetAverageAge() might be implemented.
ExampleThe classic business problem of users needing to be added,
deleted, and modified in a database is an example of where the MCC
pattern can be used. The basic model might look like the following:

In order to retrieve a User, the static method UserManager.GetUser() is
called and a variety of information could be passed in.
UserManager.GetUser would then return a User object that matched the
information passed to the GetUser method. If the user object IsDirty
and needed to be updated, a call to the UserManager.UpdateUser() method
could be called, passing in the User object of the user to be updated.
If the user needed to be deleted, a call to UserManager.DeleteUser(),
with either the UserID or the User object passed in would do the job.
If a collection of users needed to be retrieved and displayed, then a
call to UserManager.GetUsers() would be called, and an ObjectCollection
of User objects would be returned. This collection could then be easily
bound to a list control and the proerties of each User could be
displayed appropriately. To update or remove the Users, the respective
UpdateUsers() and DeleteUsers() methods could be called on the
UserManager class.
Code ExampleObject Code
(to be inserted later)
Databinding
<asp:DataGrid ID=3D"dtgDataGrid1" Runat=3D"server"
AutoGenerateColumns=3D"False">
<Columns>
<asp:BoundColumn DataField=3D"property1"
HeaderText=3D"Property 1"/>
<asp:BoundColumn DataField=3D"property2"
HeaderText=3D"Property 2"/>
</Columns>
</asp:DataGrid>
Related PatternsEngine Collection Class (ECC)
The ECC pattern is very powerful similar pattern that is slightly more
complex and offloads a lot of responsibility of the manager class into
the collection class.
Known UsesThis pattern finds itself extremely useful in the context of
.NET because of it's ability to return a bindable collection of objects
to web controls.
Version Number.1 - Draft Version
Revision HistoryDecember 5, 2001 - Pattern Captured, Bryan Costanich.
Retirement/Refresh InformationThis pattern should be refreshed once the
.NET final release is out. Additionally, when major new technology
paradigms are released such as J2EE or .NET, then this patter should be
evaluated for applicability and retirement or refreshment might be in
order.
KeywordsDesign Pattern, Architecture Pattern, MCC, .NET, Enterprise,
Components, Object Model

| [ngfx-patterns] member Click here to reveal e-mail address =3DOUR ID |
http://www.asplists.com/asplists/aspngbeta.asp =3DOIN/QUIT |
http://www.asplists.com/search =3DEARCH Archives | [ngfx-patterns] =
member
Click here to reveal e-mail address =3DOUR ID |
http://www.asplists.com/asplists/aspngbeta.asp =3DOIN/QUIT |
http://www.asplists.com/search =3DEARCH Archives=20

| [ngfx-patterns] member Click here to reveal e-mail address =3D YOUR ID
| http://www.asplists.com/asplists/aspngbeta.asp =3D JOIN/QUIT
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
 
System.Collections.ArrayList
System.Collections.IEnumerable
System.Runtime.Serialization.ObjectManager
System.Web.UI.WebControls.BoundColumn
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification