Solved

What Architecure pattern / pratice should I use?

Posted on 2011-09-18
2
233 Views
Last Modified: 2012-05-12
I am about to develop some software that will be for DeskTop, Web (Silverlight, HTML), and mobile devices.  I would if course like to use my Datalayer code for all of these environment, as you can see the only difference in the presentation is what it is aimed for.  So rather than spending the time and effort coding the datalayer for each interface.  Is there a pattern I could use which uses the Data layer.
0
Comment
Question by:IandINSW
2 Comments
 
LVL 3

Assisted Solution

by:nixkuroi
nixkuroi earned 150 total points
ID: 36564322
Try WCF and enable REST requests.  This should let you connect with Silverlight and WPF and get serialized objects with regular WCF calls, and also make RST calls with HTML and get your data that way as well.  

Here's a resource page on setting that up.  
http://msdn.microsoft.com/en-us/netframework/cc950529

0
 
LVL 3

Accepted Solution

by:
smickle earned 350 total points
ID: 36565124
At the highest level, it sounds like you would benefit from a traditional 3-tier architecture. The three tiers in this pattern generally would consist of (from top-to-bottom):
  -Presentation
  -Business/Data Access
  -Data Source

Reference on the 3-Tier pattern:
http://en.wikipedia.org/wiki/Multitier_architecture

Note these are simply "logical" tiers and some people call them layers as opposed to tiers. Each one of these logical tiers would be responsible for it's own concerns, and ideally would separate it's concerns and dependencies from the tiers below it.

Just keep in mind that each tier in this architecture can be further broken down into sub-areas, depending on the overall complexity and avaiability of your application system and hardware/servers.

All your different clients such as Desktop, Web, Mobile, etc. would each have their own UI and UI logic that would live in the Presentation tier of the application.

Since you have a DAL you want to use for all, that would live in the middle tier where Data Access components belong.

For multi-targeting clients such as your software project, I find it very beneficial to take advantage of a Service-based design as nixkuroi mentions. This gives your client apps a Facade into your main application logic. Think of the Facade pattern as a generalized API into your app.

The whole design can get blown out to a lot of patterns when you break it all down. But to keep it simple at first, just think about the highest level of the 3-tier architecture pattern.

If you feel you want to dive into a flexible and maintainable architecture, research a few of these patterns that I often live by when I work on larger projects that require multi-targeted clients with shared data sources:
  -3-tier / N-Tier pattern
  -Presentation patterns
  -Application Facade pattern (Services/Services layer in middle tier)
  -Domain Model pattern (stripped down Business objects in middle tier)
 
Hope this helps you go in the right direction.

-Steve
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to open text file 11 131
Difference between List and Array in Python 5 96
youtube blocking politics 4 59
reboot server with scheduled time and week base 4 37
This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question