3

We are going to develop a medium-large customized web app for a private company using MVC 4 and EF 5.

Early analysis and previous experiences on that business field show that it will have more than 150 tables/entities and because our customer isn't a software engineer and we know that our data model will change many times through the progress of the project.

Now, my Q is which approach is better for us according of the following:

1) Causes less effort on updating data model and data store because of many changes that will occur.

2) Takes less time to create the data store and helps progress the project faster.

Note: This app will work with big sets of data (10k, 100k objects for some entities). However, it will have few (and maybe sometimes no) concurrent requests and online users.

Thanks in advance

Amin Saqi
  • 17,037
  • 7
  • 43
  • 68
  • 2
    There are many arguments for db-first and model-first, starting from designer support up to the usage of advanced features that are not available to code-first (good comparison is here: http://stackoverflow.com/a/5446587/270591), but the ease of dealing with frequent model/db schema changes is not one of them. Migrations is a feature unique to code-first and it works pretty well in my experience. – Slauma Jul 28 '13 at 12:53
  • @Slauma Thanks for letting me know your XP. I saw the link you shared, however they doesn't cover my #1 concern: which one annoys less in lots of changes...?!? As I have more XP in db-first, I had sometimes that I wanted to cry about strange behaiviors which had caused by a change to db, in a small app...!!! – Amin Saqi Jul 28 '13 at 14:08

3 Answers3

6

I think the term

because our customer isn't a software engineer and we know that our data model will change many times

Is a reality but is not the whole reason of data model change in many times!

BTW some suggestions may be helpful
Consider business analysis a key point and do continues business analysis
More and more investing on analysis will cause less cost on development and change management
Have a specific talented analyst as a representative positioned in the customer office.
Have a specific representative of customer accountable for analysis and development team. Document the customers business process, talk about them with the customer. Document the negotiation results.
Design and change management
Never design the database alone. Brainstorming team member, invite customer representative, invite business analyst, have a DBA in design team, have a Change-Manager role.
Technology
Have a look on technology trend (may using a document-based database will be helpful)
Have a flexible framework and architecture in service of business software production and not in reverse! Changes will come ... be ready
Changes will come, all above efforts are targeted to optimized the solution to cost less when change happen, they will not prevent the changes.
You need to have an acceptable mechanism to bill them to the customer
ITIL's Service-level management, SLA and OLA will be a guide line.

So the question answers:
1) All above will help on the problem. Continues interactive analysis first, next design and develop in iterations, using template approach.Changs will come and they will cost.
2) Depends on technology and frameworks, there will be tools (I don't know EF) just don't insist on a specific platform or library.

Hope this helps.

Mohsen Heydari
  • 7,174
  • 4
  • 26
  • 44
  • Thanks, very useful. In fact we act as a second hand contractor. The first contractor gives us the db - or data model if we want. In fact we haven;t any contact with the customer, we just develop... So, I need to choose the correct approach for the platform we use that is Entity Framework. – Amin Saqi Jul 28 '13 at 09:18
  • So your customer is the first hand contractor, the pattern could be applied... cheers pal. – Mohsen Heydari Jul 28 '13 at 10:58
1

I can recommend you to use CodeFirst structure. Because your classes will be clear and mainly you work with classes much in business logic.

Jeyhun Rahimov
  • 3,621
  • 6
  • 41
  • 85
  • 1
    not need migration. you can add column to any table on database with sql script and add property to model and delete metadata table. (back up database firstly no doubt). Generally, in every structure you will have some work for migration – Jeyhun Rahimov Jul 27 '13 at 17:31
  • Or you can create 3th migration project for passing data from previous version to last version which work 2 database. I also want to say I always see codefirst structure site is faster than databasefirst to my mind.. – Jeyhun Rahimov Jul 27 '13 at 17:34
  • Code first is faster, and now he support database migration very well – Elvin Mammadov Jul 28 '13 at 07:25
0

please, look at this,this and this.

Community
  • 1
  • 1
Elvin Mammadov
  • 17,572
  • 9
  • 34
  • 76