مرجع تخصصی برنامه نویسان

انجمن تخصصی برنامه نویسان فارسی زبان

کاربر سایت

reza

عضویت از 1392/02/15

روش صحیح طراحی و پیاده سازی پروژه

  • شنبه 29 خرداد 1395
  • 14:21
تشکر میکنم

سلام به اساتید و دوستان گرامی

لطفا راهنمایی کنید که در حالتی که پروژه ما با تکنولوژی mvc پیاده سازی شود و توسعه زیاد پروژه در دستور کار باشد

پیاده سازی با روش codefirst استراتژی مناسب تری است یا database first .دلیل این امر چیست؟

بسیار متشکرم.

پاسخ های این پرسش

تعداد پاسخ ها : 1 پاسخ
کاربر سایت

mahmoodof123

عضویت از 1395/02/13

  • چهارشنبه 2 تیر 1395
  • 23:42

سلام

اگه google کنی اطلاعات زیادی در مورد هر کدام و ویژگی های آن بدست خواهید آورد.

ویژگی های کلی هر کدام به قرار زیر است.

Code first

Very popular because hardcore programmers don't like any kind of designers and defining mapping in EDMX xml is too complex.

Full control over the code (no autogenerated code which is hard to modify).

General expectation is that you do not bother with DB. DB is just a storage with no logic. EF will handle creation and you don't want to know how it does the job.

Manual changes to database will be most probably lost because your code defines the database.

Database first

Very popular if you have DB designed by DBAs, developed separately or if you have existing DB.

You will let EF create entities for you and after modification of mapping you will generate POCO entities.

If you want additional features in POCO entities you must either T4 modify template or use partial classes.

Manual changes to the database are possible because the database defines your domain model. You can always update model from database (this feature works quite good).

I often use this together VS Database projects (only Premium and Ultimate version).

Model first

IMHO popular if you are designer fan (= you don't like writing code or SQL).

You will "draw" your model and let workflow to generate your database script and T4 template to generate yout POCO entities. You will lose part of control on both your entities and database but for small easy projects you will be very productive.

If you want additional features in POCO entities you must either T4 modify template or use partial classes.

Manual changes to database will be most probably lost because your model defines the database. This works better if you have Database generation power pack installed. It will allow you updating database schema (instead of recreating) or updating database projects in VS.

 

به طور کلی بستگی به نوع کار شما و چگونگی گسترش پروژه در اینده دارد و می توان آنها را در پروژه های مختلف با فریم های مختلف تبدیل کرد.

رجوع شود به :     in google    ==>        codefirst or database first in large project

 

 

کاربرانی که از این پست تشکر کرده اند

هیچ کاربری تا کنون از این پست تشکر نکرده است

اگر نیاز به یک مشاور در زمینه طراحی سایت ، برنامه نویسی و بازاریابی الکترونیکی دارید

با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)