Design Patterns

V

vital

Hi,

I am designing the middle tier of a project.
It has 6 classes and microsoft application data access block.
The six classes are DBServices, Logger, ProjectServices ... etc.
and all these classes talk to front-end directly.

Do I need to use any design pattern in this? or what kind of
design pattern is this?

Thanks
 
M

Michael Nemtsev

it's hardly predict what do u need without detailed info
but I suggest to look at "Factory", "Singleton", "Facade", "Builder",
"Proxy" patterns.
which are most used patterns

If you are eager to build your middle-tier app regarding to all "patterns"
rules I think u need to read "Enterprise Patterns" book by Martin Fawler first
 
V

vital

it's hardly predict what do u need without detailed info
but I suggest to look at "Factory", "Singleton", "Facade", "Builder",
"Proxy" patterns.
which are most used patterns

If you are eager to build your middle-tier app regarding to all "patterns"
rules I think u need to read "Enterprise Patterns" book by Martin Fawler first

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog:http://spaces.live.com/laflour



vital said:
I am designing the middle tier of a project.
It has 6 classes and microsoft application data access block.
The six classes are DBServices, Logger, ProjectServices ... etc.
and all these classes talk to front-end directly.
Do I need to use any design pattern in this? or what kind of
design pattern is this?
Thanks- Hide quoted text -

- Show quoted text -

Hi Michael,

I am not eager to use the design patterns but want to make sure my
design is flexible and easily maintainable enough.

Do you think my design is easily maintainable?

Thanks
 
M

Michael Nemtsev

Read this article http://msdn2.microsoft.com/en-us/library/ms998544.aspx
about design review just to understand that it's impossible to provide any
feedback without any input info of your system

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog: http://spaces.live.com/laflour



vital said:
it's hardly predict what do u need without detailed info
but I suggest to look at "Factory", "Singleton", "Facade", "Builder",
"Proxy" patterns.
which are most used patterns

If you are eager to build your middle-tier app regarding to all "patterns"
rules I think u need to read "Enterprise Patterns" book by Martin Fawler first

--
WBR, Michael Nemtsev [.NET/C# MVP].
Blog:http://spaces.live.com/laflour



vital said:
I am designing the middle tier of a project.
It has 6 classes and microsoft application data access block.
The six classes are DBServices, Logger, ProjectServices ... etc.
and all these classes talk to front-end directly.
Do I need to use any design pattern in this? or what kind of
design pattern is this?
Thanks- Hide quoted text -

- Show quoted text -

Hi Michael,

I am not eager to use the design patterns but want to make sure my
design is flexible and easily maintainable enough.

Do you think my design is easily maintainable?

Thanks
 
M

Mr. Arnold

vital said:
Hi,

I am designing the middle tier of a project.
It has 6 classes and microsoft application data access block.
The six classes are DBServices, Logger, ProjectServices ... etc.
and all these classes talk to front-end directly.

Do I need to use any design pattern in this? or what kind of
design pattern is this?

You may want to take a look at this MVP is the new boy on the block. The UI
should be loosely coupled to lower and unaware of the layers like BI and
DAL. I am sure you can more articles on MVP.

UI
MVP
Business
Data Access

MODEL-VIEW-PRESENTER

http://www.polymorphicpodcast.com/

click 'Shows'

click 'Design Patterns Bootcamp: Model View * Patterns'

view part 1-5.
 
L

Liz

I am not eager to use the design patterns but want to make sure my
design is flexible and easily maintainable enough.

Do you think my design is easily maintainable?


Nobody here knows anything about your project, other than the names of three
of the six classes you are apparently intending to use; it's impossible to
say *anything* about the nature or quality of your design ... or whether
it's "easily maintainable" ...

It does seem you are sort of approaching this inside-out, looking for ways
to "use design patterns" instead of doing the analysis and then making use
of whatever patterns might be appropriate to the work you're undertaking.

I would read your post as indicating that you either would like to know more
about design patterns or that you think you *should* know more about them.
Accordingly, I'd suggest a bit of reading on the topic; there are a lot of
books available; one that I have found reasonably readable is "C# Design
Patterns: A Tutorial" by James W. Cooper

http://www.amazon.com/Design-Patter...=sr_1_1?ie=UTF8&s=books&qid=1196660677&sr=8-1

you can pick one up in "New & Used" for as low as $14 ...

Learning this material is not a one or two week project so if you're doing
something on a deadline you're probably best advised to simply carry on with
your work as best as you know how presently and learn about design patterns
independently ... unless a client or manager has directed otherwise there's
no reason that anyone has to ever know even a single thing about patterns.
That said, you will probably find at least some of them useful, even
interesting ... and in some shops, you *will* be expected to be conversant
with them

There's no magic in this stuff; it's just tried and true ways of
approaching problems. Some people find patterns they've already been using
so the only thing new is learning that there's a name for what they've been
doing. Generally, though, you will probably be seeing things that are novel
and you'll need some time to absorb the concepts and start putting them to
work.

In the interim, poke around Wikipedia for an overview of the topic
 
V

vital

Nobody here knows anything about your project, other than the names of three
of the six classes you are apparently intending to use; it's impossible to
say *anything* about the nature or quality of your design ... or whether
it's "easily maintainable" ...

It does seem you are sort of approaching this inside-out, looking for ways
to "use design patterns" instead of doing the analysis and then making use
of whatever patterns might be appropriate to the work you're undertaking.

I would read your post as indicating that you either would like to know more
about design patterns or that you think you *should* know more about them.
Accordingly, I'd suggest a bit of reading on the topic; there are a lot of
books available; one that I have found reasonably readable is "C# Design
Patterns: A Tutorial" by James W. Cooper

http://www.amazon.com/Design-Patterns-Tutorial-James-Cooper/dp/020184...

you can pick one up in "New & Used" for as low as $14 ...

Learning this material is not a one or two week project so if you're doing
something on a deadline you're probably best advised to simply carry on with
your work as best as you know how presently and learn about design patterns
independently ... unless a client or manager has directed otherwise there's
no reason that anyone has to ever know even a single thing about patterns.
That said, you will probably find at least some of them useful, even
interesting ... and in some shops, you *will* be expected to be conversant
with them

There's no magic in this stuff; it's just tried and true ways of
approaching problems. Some people find patterns they've already been using
so the only thing new is learning that there's a name for what they've been
doing. Generally, though, you will probably be seeing things that are novel
and you'll need some time to absorb the concepts and start putting them to
work.

In the interim, poke around Wikipedia for an overview of the topic

Hi Liz,

Thanks for taking lot of time in explaining. I am doing this project
at work and
nobody told me to use design patterns. But I want my design to be
robust so
I wanted to know is it useful to go after design patterns or simply go
ahead
with my design.

I have until January to start the coding for the project. I already
designed my classes
and some methods but in the meanwhile I want to know whether I can use
any design
pattern to make my project robust.

what kind of information do u need from me in explaining what kind of
design pattern I am
using If I am using one or needed to be used.

Thanks
 
D

DeveloperX

Hi Liz,

Thanks for taking lot of time in explaining. I am doing this project
at work and
nobody told me to use design patterns. But I want my design to be
robust so
I wanted to know is it useful to go after design patterns or simply go
ahead
with my design.

I have until January to start the coding for the project. I already
designed my classes
and some methods but in the meanwhile I want to know whether I can use
any design
pattern to make my project robust.

what kind of information do u need from me in explaining what kind of
design pattern I am
using If I am using one or needed to be used.

Thanks- Hide quoted text -

- Show quoted text -

Your best bet would be to read the links above and familiarise
yourself with things like MVP, singleton, factory, etc, and also start
coding a prototype. If you hit any specific issues with the prototype,
bring those to the forum and people can probably help more.

For example you have a Logger class. I would assume this is used for
error/message logging? You might want to investigate the Microsoft
application diagnostic block here as it provides a simple(ish) general
way of creating logging classes which log what you want where you
want, ie to a database, email, text file, and so on by defining
classes that implement IExceptionPublisher and adding a line to the
config file. Not knowing what your logger class is trying to do though
means that advice may be over kill or inappropriate.

Other information that is always handy is which framework version you
are targetting and what the application is supposed to do. Also, you
seem adamant that you're going with three tiers, but as we don't know
what the app is going to do, how long you have to develop it or who
will use it and how many, we can't even confirm that assumption is
correct.

Finally, patterns show you how to do something in a repeatable, proven
way. They don't tell you whether you need to apply that pattern. One
of the simplest patterns is the singleton which you could learn in
about 10 minutes. It will take significantly longer to know when or if
you need to apply it.
 
C

Cowboy \(Gregory A. Beamer\)

If you want a quick "briefing" on how to set up your project with patterns,
consider the .NET Design Pattern Framework from dofactory.com.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
J

Jeff Louie

Vital... At a minimum I would try to separate out the application logic
from the GUI (view and event handling code). There should be an entry
point to the application service that can be unit tested from a command
line console application. You can look at this as Model-ViewController
or ENGINE-INTERFACE where the Model or Engine encapsulates the
application logic, service or algorithm.

Regards,
Jeff
 
L

Liz

I have until January to start the coding for the project. I already
designed my classes
and some methods but in the meanwhile I want to know whether I can use
any design
pattern to make my project robust.

I'd suggest you dive in to the material: see, for example, what Factory,
Facade, Mediator patterns are, and go from there; if you see relationships
to your work and discern a rationale for employing a pattern, go for it

Since you mentioned having only six classes in your architecture, unless
this is an application of very limited scope, I'd venture a guess that your
present design is quite a bit more tightly coupled ... hard-coded ... than
it would be if you employ some of the commonly known and used design
patterns. But context is everything: in a one-off silo application it might
not be worth the effort to do all the abstraction work which is becoming
orthodoxy in the field .. you'll have to make that call since you know the
app, the stakeholders, the budget and your own level of proficiency
what kind of information do u need from me in explaining what kind of
design pattern I am
using If I am using one or needed to be used.

I, or anyone else, would have to review more material than I think is
practical in this medium; why don't you try to present some reasonably
specific questions to the group ... there are a lot of able and helpful
people around here who might be able to offer some good advice in that
context
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top