473,387 Members | 3,810 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,387 software developers and data experts.

Should I make lots of objects? :-)

Hi all,

I'm hoping that someone could help with the following general question:

I'm making a website that manages beta releases of software. It does various
things like store bugs, comments, work arounds and feature requests. Users
can subscribe to be notified if a feature or bug is detected in their area
of interest.

The software developer can publish new and polls and all sorts of crap like
that.

My question is, is it good practice to create a class or struct for nearly
all the nouns in the statements above.

I currently have classes representing Users, Roles, Permissions.

I'm wondering if I should create classes for things like bus, comment,
feature requests and so on or should I just pass around datasets and
datarows to represent the data and have other classes work on those data
collections.

If I should use custom objects for most of these requirements should I
always initialise them in the data layer before passing them back up to the
buisiness tier?

Thanks to any advice you can offer.

Kindest Regards

tce
Nov 16 '05 #1
5 1022
"Simon" <sh856531@microsofts_free_email_service.com> wrote:
Hi all,

I'm hoping that someone could help with the following general question:

I'm making a website that manages beta releases of software. It does various
things like store bugs, comments, work arounds and feature requests. Users
can subscribe to be notified if a feature or bug is detected in their area
of interest.

The software developer can publish new and polls and all sorts of crap like
that.

My question is, is it good practice to create a class or struct for nearly
all the nouns in the statements above.

I currently have classes representing Users, Roles, Permissions.
Please tell me that you have looked into GenericIdentity,
GenericPrincipal, IIdentity, IPrincipal first?

..NET Framework Class Library GenericIdentity Class
http://msdn.microsoft.com/library/de...classtopic.asp

..NET Framework Class Library: GenericPrincipal Class
http://msdn.microsoft.com/library/de...classtopic.asp

..NET Framework Class Library IIdentity Interface
http://msdn.microsoft.com/library/de...classtopic.asp

..NET Framework Class Library IPrincipal Interface
http://msdn.microsoft.com/library/de...classtopic.asp

..NET Framework Class Library CodeAccessPermission Class
http://msdn.microsoft.com/library/de...classtopic.asp

..NET Framework Developer's Guide Permissions
http://msdn.microsoft.com/library/de...ermissions.asp

I'm wondering if I should create classes for things like bus, comment,
feature requests and so on or should I just pass around datasets and
datarows to represent the data and have other classes work on those data
collections.

Depends - if this is a simple application that won't change
much once its built then you can get away with the "Smart
UI" approach.

If this is something that may need to change continually it
may be worth the effort to model YOUR business of issue
management right now so that you can reap the benefits later
- if you feel up to the task. However creating lots of
different classes left, right and center is usually a bad
idea - it usually is a sign that you haven't explored the
commonalities and differences of your system's entities
enough.

If I should use custom objects for most of these requirements should I
always initialise them in the data layer before passing them back up to the
buisiness tier?

Thanks to any advice you can offer.

Kindest Regards

tce


Nov 16 '05 #2
I have no problem with lots of objects as long is it does not impede on
performance. Usually it will take a hell of a lot of objects before
performance will degrade.

In past projects that I have worked on, I find it beneficial to defined
objects and initialize them in the data layer. Basically, the data layer
reads the information from the database and sets the necessary properties.
That way the consuming code does not need to be aware of issues like row and
column format of the dataset. It also helps the compiler perform type
checking if you use actual objects. Objects are just easier to use and are
for the most part self documenting. Suppose that you have an object called
Comment with a property called Text. It is easier to read this then to get
row X, column Y of some dataset.

This is just my opinion and others may view things differently but I find
that the benefits outweigh the consequences.

Now, there is something that you might want to consider, whether you want to
communicate a lot with the database or store all those objects in memory.
One idea might be that if you create an object hierarchy, you might not want
to load some objects until they are actually used. There is no point in
having something in memory that might never be used. Therefore whenever you
call a property, it can call the data layer to initialize the information
and return what you expect. Or you could load all information when the
highest level object is created.

"Simon" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Hi all,

I'm hoping that someone could help with the following general question:

I'm making a website that manages beta releases of software. It does
various things like store bugs, comments, work arounds and feature
requests. Users can subscribe to be notified if a feature or bug is
detected in their area of interest.

The software developer can publish new and polls and all sorts of crap
like that.

My question is, is it good practice to create a class or struct for nearly
all the nouns in the statements above.

I currently have classes representing Users, Roles, Permissions.

I'm wondering if I should create classes for things like bus, comment,
feature requests and so on or should I just pass around datasets and
datarows to represent the data and have other classes work on those data
collections.

If I should use custom objects for most of these requirements should I
always initialise them in the data layer before passing them back up to
the buisiness tier?

Thanks to any advice you can offer.

Kindest Regards

tce

Nov 16 '05 #3
Thanks for the advice.

I've looked at the built in authentication classes in .net. I don't like
them and want to make my own. Simple as that.

Simon
Nov 16 '05 #4
xxx
Sorry, I didn't quite get that. What do you mean?

"thechaosengine" wrote:
Thanks for the advice.

I've looked at the built in authentication classes in .net. I don't like
them and want to make my own. Simple as that.

Simon

Nov 16 '05 #5
The short answer is yes.

For me, it is a simple choice between two alternatives:

1. Pass all data around in raw DataSets. Have application code operate
on those DataSets. This means, for example, that the code for
manipulating a Bug report (accepting a new one, updating one, attaching
it to a code change, closing one) is spread over a half dozen Forms.
Now someone asks me to add a new field to a Bug report, so I have to go
hunting throughout all of my Forms, and the hunt isn't easy, as the
only thing I have to help me is some column names. Or,

2. Create an object for every different kind of thing I'm manipulating
in my application, whether or not I choose to continue to hold my data
in DataSets. Even if a DataSet, or a DataRow is my preferred way of
storing information in memory, I have at least gathered all of the
operations that I'm allowed to perform with a Bug in one class, in one
spot. If that behaviour has to change, I know where to go. If I'm
looking for which Forms display the BugNumber, for example, I can
search on the property name of the class, rather than just a column
name.

Now, just because you create an object hierarchy does _not_ mean that
you can't use DataSets to store your data. In my case, I went whole hog
and copied the data out of the data sets into the objects' private
fields, but that's only one possibility. Regardless of how you
implement the classes, you should certainly use the class hierarchy as
a tool to organize your code.

Only a very, very simple application can afford to have its business
logic coded into a Form somewhere. What you're doing sounds moderately
complex.

Nov 16 '05 #6

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

Similar topics

0
by: Mickel Grönroos | last post by:
Hi everybody, This is a question about Tkinter.Canvases and performance: I am writing a Tkinter application that among other things contains a number of Tkinter.Canvases that in turn hold...
1
by: Ken Fine | last post by:
I have a menu system that has nodes that can be opened or closed. In an effort to make my code more manageable, I programmed a little widget tonight that keeps track of the open/active item and...
10
by: AlexS | last post by:
Hi, I wonder if anybody can comment if what I see is normal in FW 1.1 and how to avoid this. I have .Net assembly, which creates literally thousands of temporary strings and other objects...
5
by: Simon | last post by:
Hi all, I'm hoping that someone could help with the following general question: I'm making a website that manages beta releases of software. It does various things like store bugs, comments,...
6
by: Terry Bell | last post by:
We've had a very large A97 app running fine for the last seven years. I've just converted to SQL Server backend, which is being tested, but meanwhile the JET based version, running under terminal...
4
by: hufel | last post by:
Hi, I'm doing my first big project in C# and I'm stuck with a problem that I believe has a simple and efficient solution for it (I just haven't bumped into it yet...). The concept is the...
21
by: TAM | last post by:
Hi, I read that ASP.NET uses VB.NET instead of VBScript. I also read that ASP.NET is a subset of VB.NET. So if I learn VB.NET first then do I have the knowledge for programming ASP.NET...
8
by: vvenk | last post by:
Hello: I just wrote my first ASP.Net application. It worked fine on my machine and when I put into production, the ASP.Net process reaches 50% quite fast and then the system does not work...
16
by: InDepth | last post by:
Now that .NET is at it's fourth release (3.5 is coming soon), my very humble question to the gurus is: "What have we won with the decision to have string objects immutable? Or did we won?" ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.