Need an advice about application's architecture - c#

I am trying to build an application's architecture these days and I will be glad to hear some advice. Here are some details about the application itself. It has a web UI where customers could register and pay (with credit card) for some sort of services. They have to provide some info because these services are based on it. For example dates to schedule the service work. Of course they always can check the status of their order via the site.
Also I have a database (classic relational database or NO-SQL database I am not sure what is better in my case) that located on other physical machine. So I have to take customers' info and store it into the db in order to make some work based on it. Besides there is a windows service or it's Linux analogue that makes the main job. It should create processes based on the information in database to do the job. In other word the services I mentioned in the beginning provided not by business logic of the web site but of the windows service. Of course during its work this service stores an information back to my database or update it in some way.
Recently I have read the book about applications architecture from Microsoft and they introduce there many approaches to build an application. For example DDD or Client / Server or Components based architecture an so on. I am really confused what is the most suitable in my case. Could someone please advise me something. Thanks in advance.

Take 10 steps back and learn programming. Seriously.
Recently I have read the book about
applications architecture from
Microsoft and they introduce there
many approaches to build an
application. For example DDD or Client
/ Server or Components based
architecture an so on
This is part of your problem. MS did none of that. These concepts where around 20 years ago. They were around 10 years ago. The Book from MS basically just presents them to you. You tink a book makes you someone understanding them?
Things are a little more complicated.
Take your question, replace "application" with "car" etc. and you may realize how really funny the question is. "Need advice about car architecture" etc. - you seem to have a VERY shallow understanding of even what you are talking about.
Also I have a database (classic
relational database or NO-SQL database
I am not sure what is better in my
case)
You know what a relational database is about? Ever heard of ACID conditions? If not - learn them.
I suggest you get profesional help. Why? Because otherwise the moment your credit card data gets stolen (and no, you wont even know how to write secure code with the understanding of SQL you showed) you are in legal pain hell. Everyone will sue you - customers, credit card companies (you know how to treat credit card data, right - I mean, legally).

To get started, read a lot about application architecture.
There are quite some books available out there that you can buy.
My favorite book that weaves a lot of
these together: Software Paradigms
The one that will help you get a lot about programming, design is "software paradigms".
It has been one of my favorite books that covers a lot of ground on topics like patterns, components and architecture.
http://books.google.com/books?id=kfGHwo2E0FYC&printsec=frontcover#v=onepage&q&f=false
Architectural, patterns and practices
from codeplex
There is also a architectural, patterns and practices that was started as part of codeplex and available now as part of msdn. This is available directly on net and you can start reading it.
http://msdn.microsoft.com/en-us/library/dd673617.aspx
http://apparch.codeplex.com/
Other resources on net:
http://www.handbookofsoftwarearchitecture.com/index.jsp?page=Main
Other helpful quick reads:
Architecture of transaction processing system: http://www.cs.sunysb.edu/~cse515/Fall07/slides/ch26.ppt
On SO itself:
How To Maintain Transaction in N-Tier Architecture

Absolute resource for App Architecture:
Microsoft Patterns & Practices Application Architecture Guide 2.0.
I've learnt alot from it, and still learning!

i've recently read agile princeple,patterns and practice by robert martin. I think it's a good book to start understanding desing patterns and architecture principles

Related

How to write a good core architecture for a project in ASP.NET MVC

I'm going to have to write a big system in January with ASP.NET MVC3 / C#, and need to know how to write a system that will WORK. I do have a bit of experience with ASP.NET MVC and C# but would not call myself an expert. It needs to be extensible so that I can extend it later with new features. How would one go about this? Is there books that explains this topic in detail or should I use trial and error?
In short I need to know good design practice in my code thats extend-able for the future.
Regards
RaVen
The System will be a community portal with forums ratings etc. Cant say more than that << Company Policy>>, The forums I can manage because of plenty open source options... But the rest is up to me.
SOLID == Great Success
Follow SOLID principles in any project and you'll do well.
With regards to core infrastructure/architechure, SharpArchitecture is a good place to start. It is by no means the perfect solution...BUT they give you a good framework to play with and you can have a working system quickly while learning the concepts that work and don't work over time. Take a look and see what you think. It uses NHibernate, Castle and MVC.
Test Driven development will ensure quality for your project. Be strict with yourself, red green refractor. One of MVCs strengths is that it's easier to test.
Professional ASP.NET MVC 2 is a good starting point, though, I would assume that they'll come out with an MVC 3 edition as well. The NerdDinner tutorial contains a lot of ideas on how to structure your application.
Basic advice: work with the MVC architecture, not against it. Understand your application, especially your data model, and layer that onto your application structure. Typically you'll have a controller per model, but not always.
If you want more detailed advice, you'll need to be more specific about your project. I'd suggest coming up with specific questions about various details of your design as you have them, rather than a single question covering the whole project. The latter probably won't get the kind of response you desire.
you can use my "awesome" demo as a start
http://awesome.codeplex.com
If it's going to have to be extensible, make sure you write tests. You'll save yourself sleepless nights in the long run when you fix something, but ended up breaking the entire system.
As far as how to make things "WORK" - that depends on your ability. Read, and look to improve things, but don't get caught in premature optimization or it will leave you dead in the water.
Based upon your edit and your abilities, it might be wiser to select an open source CMS written in ASP.NET MVC and support it. Your skills are good enough, it sounds like, to learn how to write modules and be part of a larger community. You do not sound like you really want to write the whole thing because you are timid about your skills, deadlines, etc. Whilst learning the ins and outs of a well written piece of software, one day you may choose to write your own or contribute to a core piece of the software. There are several to choose from see my comment above under your question.
edit: I also think this will allow you to just start and not worry about every design paradigm people will throw at you for success.
WhoCanHelpMe is a nice reference application. It's built upon S#arp Architecture which is a good starting point for an MVC-application using domain driven design. That will also help you on the way with wiring IoC and db-stuff.
Remember that not every example and framework will fit your requirements, so do as jFar said, think SOLID and make your own decisions based on principals.
You should also look into MEF for extensibility.

Getting familiar with .NET - What's the best way?

I have a friend of mine who owns his own software consulting business. Most of the stuff his employees work on is .NET related development. He's been out of actual development for many years, and has been focused on building his business. He asked me the best way to get familiar with the whole .NET platform and development under .NET. Is anyone aware of a video training series, or something similar, that's designed to get someone up to speed on all aspects of .NET?
This is the obligatory "port another project into .NET" answer.
My guess is that he doesn't have to cover all of .NET, but a great way to get up to speed with both C# and a significant part of the .NET framework is the C# 4.0 in a Nutshell book. It assumes some programming experience and covers a lot of stuff.
In my opinion the first step is to read a book which covers different parts of .Net Framework. Pro C# 2010 and the .NET 4 Platform is one possible book as it covers different technologies such as WPF, WCF, Linq, Ef, Asp.Net. They are not discussed in depth but is a good resource for getting familiar with current technology stack.
Also, I would recommend actually developing in .Net as is many knowledge comes from the actually doing it.
In addition to the other answers, maybe your friend could sit in on any code reviews, design sessions or even perform pair programming with the other developers once he gets a basic understanding of things on his own. I suppose this could be difficult in a consulting business vs. regular development shop though.
In addition to all of the books and blogs which will be mentioned, I always recommend people start learning with something practical.
When I'm teaching I make up simple exercises broken down into chunks like build a basic database, try simple things like displaying the data, filter the data using drop down, add auto postbacks and update panels, updating the data in the DB. It doesn't take long to get an overview of the basic concepts, techniques and tools when presented with examples. And then it's down to experimentation, imagination, and research!
Buy Visual Studio and an MSDN membership - in case its a startup there maybe various options to reduce this cost (Bizspark/Websitespark)
Go through common walkthroughs - areas to go through are Winforms, Asp.net, Asp.net Ajax in that order. Can go through WCF, Silverlight and other framework options later.
Search the web for 'Azure trial' - supposedly, there is a one month free pass available. Dont know if this is real, but if it is, take it and deploy simple applications on the cloud - learn what Windows Azure and Sql azure are all about. After a while can learn about Appfabric messaging platform as well.
After this, start deep-diving into any areas of the technology depending on project needs.
Channel 9
ASP.NET getting started
Dimecast
DNR TV
more than reading any book what made get started with .NET was doing projects. Start building a web site if you want to learn ASP.NET, you get to learn C# and VB as well like this. Just by reading a book each chapter would take lot of time. Initially you will do lot of mistakes and you will frequently get the dreaded yellow error page. The more mistakes you make, the merrier. My experience with .NET is limited to ASP.NET, C#,LINQ, web services, SQL Server 2008. But it took less than 20 days for me to get to know about all these stuff. Now I am trying to do WPF, WCF, Silverlight projects. IF I read any .NET book now, it wouldn't take much time for me to complete it.
I realy suggest to use a step by step teach your self book. They are good for beginners and have some practices maybe something from SAMS publishing like
Teach yourself c# in 21 days

Planning a programming project by example (C# or C++)

I am in the last year of undergraduate degree and i am stumped by the lack of example in c++ and c# large project in my university. All the mini project and assignment are based on text based database, which is so inefficient, and console display and command, which is frustrating.
I want to develop a complete prototype of corporate software which deals in Inventory, Sales, Marketing, etc. Everything you would usually find in SAP. I am grateful if any of you could direct me to a books or article or sample program.
Some of the question are :
How to plan for this kind of programming? should i use the concept of 1 object(such as inventory) have its own process and program and have an integrator sit for all the program, or should i integrate it in 1 big program?
How to build and address a database? i have little bit knowledge in database and i know SQL but i never address database in a program before. Database are table, and how do you suppose to represent a table in a OOP way?
For development type, which is better PHP and C++ or C# and ASP.NET? I am planning to use Web Interface to set form and information, but using a background program to handle the compute. .NET is very much integrated and coding should be much faster, but i really wonder about performance if compared to PHP and C++ package
thank you for the info
This may not answer your question directly, but I thought this might help you get started in some way. So here it goes: I would say, "think through the process". This means, think through the software development process:
Gather requirements
Identify and define the problem.
Get as much information/facts as you can. (turn on green light, think about everything that you want to go into your software)
Come up with a baseline (turn on red lights, what you really want? the minimum functionality your software "must have" - cant live without)
Analyze
Know what you don’t know, what are the missing facts?
Evaluate your information or lack of it/reliability of information source.
Infer facts that you don’t know.
Form an assumption, opinion, or possible solutions.
Consider alternatives and implications of each solution.
Form an action plan.
Identify technology pros/cons.
Decide technology
Comeup with a functional specs.
Research
Dig into stuff that you would want to know (Best database, ORM, design practices, code samples - gather everything, read about inventory systems that are already there)
Design
Develop
Test
Fix
Prepare deployment plan
Release the product
Gather user feedback
Analyze user feedback
Plan for items in next release.
Repeat steps
And Enjoy!
Before I start this is a shallow answer to a deep question.
1) It looks like you have a reasonable grasp of the major components of your target application. As a .net developer I'd build assemblies that matched broad areas of functionality (not sure what the equivalent is in PHP) and then you can use those assemblies together as a single large app, or seperately as required. It's unlikely you'll get it right first time, so build it how it feels right, and then do some ruthless refactoring to make it better once you've got a handled on the problem.
2) This whole area is covered by Object Relational Mapping - ORM, NHibernate is the best of the bunch in the .Net world. BTW if you learn that you'll be way ahead of the game come graduation/work time. Raw sql is so last decade. I guess you know that Sql Server Express is a free download?
3) For development go with the languages/environment you feel most comfortable in. My preference is .net, and the integrated coding is much faster. Performance is definitely good enough, especially as this is learning project - SO runs on .Net and that supports a gazillion users pretty well.
Enjoy
I don't have any good recommendations for SAP-like projects in particular, but in general the best examples to use for things like this are well-established open-source projects. Anything else is going to be a "toy" example in one way or the other, and will be simplified and cleaned up. It's the "cleaned up" that makes it most unrealistic -- one of the really key things that makes real-world large software projects different from university examples is that the real world is messy, and real-world requirements are messy, and collaboration between lots of people with not quite the same priorities is messy, and real-world software projects have to adapt to and thrive in this messiness.
In answer to your specific questions, though:
1.) Do things in a modular way. This means you have something you can test and work with as soon as you get the first module done. That's especially important when you're learning, because (a) you probably won't have time to actually finish the whole thing, (b) you'll learn a lot from writing the first bit that you'll want to apply in future bits and then you'll probably want to rewrite the first bit, and (c) you'll learn even more from using the first bit.
2.) There are many views on this, and many online articles and books. I can't answer that in an answer here (except to note that in some cases trying to represent it in an OOP way is the wrong programming paradigm -- be careful about overconstraining the answer by the question you ask!); the right answer is to find things to read and spend some days reading them.
3.) You do not care about that sort of performance issue here. Successful programs have been written in both forms. You care about what will teach you the most, and what you are comfortable working with. Either one should be fine. You'll probably find more open-source pieces to look at with PHP and C++.
Your question pretty much covers the whole gamut of planning for a project; a whole thesis might be written (+:
Keep in mind what your team and your teaching-staff want out of the project.
1) Modular is my choice. It'll force you to address the application one module at a time and keep you focussed, but that is subject to
The familiarity of your team with the preferred/recommended language for this project.
Time in hand
Remember that modular means you will necessarily have to provide for module integration too.
2) C++ or C# ? Whichever offers the more learning experience. My own experience with both mentioned technologies is limited, but I remember there used to be a Database Template Library (DTL). C# on the other hand will probably be faster to develop. I could be wrong. There are any number of free DBMS engines available on the net. Unless the assignment explicitly recommends using a text, opt for one of these.
3) I concur w/Brooks up there ^^^
Good Luck!
You are a university undergraduate. And you are talking about complete inventory system.
I suggest building a blog application first with all the best practices (like blogengine), then move to e-commerece sites (nopcommerce, dotcommerce). And then do whatever you like.
This is a common problem with undergrads like you, of jumping way higher without building any simple projects first.
As a full time PHP developer, PHP sucks! ASP.net is okay (mmm... no it sucks too), but it locks you into proprietary licenses.
If you're starting from scratch, go for node.js. It's c++ and server-side javascript. Yes, it's new, but it has engineering promise. It'll be more commonplace in a few years.
And if you're worried about performance, don't. Javascript in V8 is extremely fast.
http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php
Here are some node.js links to get you started:
http://www.delicious.com/homer6/nodejs
Enjoy.

how to start/proceed for implementing database layer for C#.net

It's first time for me to start with something like this. In applications with decent size DLL (Data Logic Layer), BLL (Business Logic Layer) is common to implement.
But with no great experience around this area i am struggling regarding where to start. Most of the time i did simple application where to open connect, get data, close connections. And this is not good with application of good size. right ?
I visited some sites but Architectural aspects are not thoroughly covered, most of people focus on small issues/steps. So please provide inputs regarding how can is proceed, books, blogs.
Take a look at what ORMs, like NHibernate, do. I'm not saying they will be perfect for your situation but you can assess and make your own judgement.
Here is a more in depth overview of
ORMs
and there are lots more resources here to help you learn the architectural aspects
Yes, Russell is right. It is better to go with ORM like NHibernate or Codeplex ODX which helps to serve as a facade to Database and later create business library using the ORM to manage the business logic.
Unfortunately I also did not get the information about clean and enterprise coding standards until I started working in a large enterprise.
But the bottom line is all the enterprises uses the same mantra which is "DIVIDE AND RULE". In programming this is nice because it is easy to maintain, manage and break fix the application.

Starting a new Site - Should I "Use a Template" or "Write from Scratch"

I have been thinking of starting a site of my own for long time. I am good at all concepts of C#/ASP.NET and all DB stuff. I have created and can create a site from scratch for myself. But the effort/time involved in creating a site from scratch is little discouraging, where next thing (and more important thing) I need to worry about is the content on the site.
I have seen many sites and blogs (few links below).
I need to know, what is the general approach while creating a similar site?
Are there any general tips i need to be aware of before starting one?
http://naspinski.net
http://codeclimber.net.nz
Do you mean stating you own Blog?
you can open blog on some free service as Blogger and see how it goes.
Later you can buy you own domain name and hosting, install existing Blog engine there(even open source if you want to tweak it) and continue from there.
after comment clarification:
Buy a domain name, buy disk space and traffic from hosting company. Install ant cms(content managment system)/blog/forum/anything else you wan ton the host. Develop only the parts you can't find in existing cms/blog systems. No need to develop everything from scratch. With saved time you can take any open-source blog/cms engine and help them with patches.
Consider some open source C#/asp.net blogging platforms:
Oxite
BlogEngine.NET
Subtext
If you're talking about a blog site, there's no need to reinvent the wheel unless you just want to. There are plenty of capable blog engines in any language of your choice. Go with one and extend it if necessary.
Building your own blog engine is fast and easy. Building a good one is slow and hard. I've written many iterations of my blog - currently version 6 using ASP.NET and C#, and working on the design for version 7.
As to whether it's worth it, that's really your call. Do you code in your free time? Enjoy it? Are you willing to go through the whole lifecycle?
You will be responsible for:
Analysis & Design
Development
Testing
Deployment
Prod support
It's worth it to me. Is it worth it to you?
It really depends how much time you're willing to spend on it and what kind of site.If you want a blog site,there are a lot of free blog engine out there that you can use and takes a little time to make it live.My number one recommendation is blogengine.net...very flexible,a lot of choices for theme,and easy to set up.However, if you're like me that is willing to spend a lot of time building it then go for it.I started building my site....a social networking site(http://www.joecaps.com) December 2008 and until now I'm still building it.

Categories

Resources