Tuesday, January 3, 2012

CodePlanner 0.2 Released

Hi there, I´ve just released CodePlaner 0.2 on nuget.org.
This is still a very early BETA version and there are still issues to fix and features to add…

However, in CodePlanner 0.2 I´ve added jQueryMobile as the default GUI being scaffolded.
(Btw, it does not matter if you are new to CodePlanner, the video will be basic/getting-started).

Video – CodePlanner 0.2 version

 

When should I use CodePlanner?

You can use CodePlanner for any project, but with a legacy database you need to do either reverse engineering or write some mapping classes for your domainmodel (code first).
The most common scenarios would be…

  • Build a system from scratch
  • Build a new system and you are not sure on your domain model… Scaffold, edit and re-scaffold
  • You need to do a POC… You´ll have a running system in minutes!
  • Or perhaps you just want to see one way of many possible ways to do an architecture?

How do I use CodePlanner?

  1. Create a new MVC3 project in VS 2010
  2. Open “Package Manager Console” (Tools –> Library Package Manager –> Package Manager Console)
  3. Write “Install-Package CodePlanner” Hit Enter
  4. …Wait for installation to complete.
  5. Add your domainmodel to the new Core Project. (Remember to inherit PersistentEntity).
    See readme file in MVC3 project for more info…
  6. In the “Package Manager Console” Write:
    Scaffold CodePlanner.

DomainModel example

This is the domainmodel from the demo. Just paste this in your Core project and scaffold to get a system like the one in the video.

[DisplayColumn("Name")]
public partial class Company : PersistentEntity
{
   
[Required]
   
[MaxLength(50)]
   
public string Name { get; set; }

   
[Required]
   
[MaxLength(50)]
   
public string Location { get; set; }

   
public virtual IList<Person> People { get; set; }

   
public virtual IList<ProductCategory> ProductCategories { get; set; }
}

[DisplayColumn("Name")]
public partial class ProductCategory : PersistentEntity
{
   
[MaxLength(50)]
   
public string Name { get; set; }

   
[MaxLength(200)]
   
public string Information { get; set; }

   
public int CompanyId { get; set; }

   
[ForeignKey("CompanyId")]
   
public virtual Company Company { get; set; }

   
public virtual IList<Product> Products { get; set; }
}

[DisplayColumn("Brand")]
public partial class Product : PersistentEntity
{
   
[MaxLength(50)]
   
public string Brand { get; set; }

   
[MaxLength(200)]
   
public string Description { get; set; }

   
public int Price { get; set; }

   
public bool Active { get; set; }

   
public int ProductCategoryId { get; set; }

   
[ForeignKey("ProductCategoryId")]
   
public virtual ProductCategory ProductCategory { get; set; }
}

[DisplayColumn("Name")]
public partial class Person : PersistentEntity
{
   
[MaxLength(50)]
   
public string Name { get; set; }

   
[MaxLength(200)]
   
public string Information { get; set; }

   
public int CompanyId { get; set; }

   
[ForeignKey("CompanyId")]
   
public virtual Company Company { get; set; }
}

Thanks for reading, and feel free to provide feedback!

twitter.com/ulfbjo or twitter.com/codeplanner

Regards
Uffe

1 comment:

  1. Hi Uffe,

    thanks for this awesome tool. As I am new to MVC 3, dependency injection (ninject) and EF code-first, I find it particularly helpful to get me on the right track on how to architect my solution, and also to better understand how the code works.

    ReplyDelete