New Posts New Posts RSS Feed: Cocktail v0.5 is available for download
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Cocktail v0.5 is available for download

 Post Reply Post Reply
Author
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Topic: Cocktail v0.5 is available for download
    Posted: 28-Mar-2012 at 5:09pm
Just released a new stable version of Cocktail.
 
 
If you feel like contributing to Cocktail, check out the new CocktailContrib project on github.
 
 


Edited by mgood - 03-May-2012 at 5:35pm
Back to Top
paul View Drop Down
Newbie
Newbie


Joined: 16-Sep-2010
Posts: 19
Post Options Post Options   Quote paul Quote  Post ReplyReply Direct Link To This Post Posted: 29-Mar-2012 at 2:54pm
Since moving to 0.5 I've lost all my Cocktail logging in my debug's output window. Did something change since 0.4?
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 29-Mar-2012 at 3:22pm
Only the debug assemblies log to the output window. What's new in 0.5 is that TempHire always uses the release assemblies, but if you use the debug assemblies in your solution, you should see the log output. If not let me know.
Back to Top
paul View Drop Down
Newbie
Newbie


Joined: 16-Sep-2010
Posts: 19
Post Options Post Options   Quote paul Quote  Post ReplyReply Direct Link To This Post Posted: 29-Mar-2012 at 3:29pm
I used Nuget to get 0.5. I assume those are probably release only. 
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 29-Mar-2012 at 4:44pm
That's correct. NuGet packages typically contain release assemblies and that applies to Cocktail as well. You can download the debug assemblies from CodePlex and during development copy them over the assemblies in the packages folder.
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 30-Mar-2012 at 3:34am
Is it just me, or has the Repository structure in the TempHire application changed drastically from v04 to v05? If so, could you please just give a quick overview of the changes... 

ie. I can see that there is a Repository<T> class as part of the Cocktail.Contrib namespace, I take it that this replaces the old IRepository & RepositoryBase classes?
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 30-Mar-2012 at 11:05am
That is correct. As stated in the release notes, TempHire got refactored to use the unit of work design pattern to demonstrate a more scalable approach.
In v0.4 and prior, TempHire used a simplified approach that is sufficient for smaller applications, but doesn't follow the proper theory on domain driven development. As one's application grows in complexity, this simplified approach will show its limitations and requires to be refactored into what you see in TempHire as of v0.5. We have many customers using the simplified approach, so there's nothing wrong with it per se, but it has limitations. For example eventually you may have cross module workflows in your application. With the simplified approach, there's no easy way for multiple repositories to participate in an overarching workflow unless your application uses a single EntityManager.
 
The base implementation of what you see in TempHire is currently part of a new project called CocktailContrib. CocktailContrib is meant as a breeding ground for new features and a place where the community can contribute to Cocktail. As with pretty much all the features in Cocktail, they got previously tried out in an actual real world project to make sure they work as intended before making them part of Cocktail. Same goes for this. Once we get some mileage on it, the UoW implementation will eventually become part of Cocktail itself.
 
In the meantime, you can add CocktailContrib to your project via NuGet: http://nuget.org/packages/CocktailContrib. That's the easiest way and it will ensure that you use the correct version of Cocktail to go with it. Or you can download the sources from github: https://github.com/marcelgood/CocktailContrib
 
In textbook domain driven development you have domain model objects (entities and value objects), factories, repositories, services and units of work. So, let me give a quick overview on each one:
  • Domain model objects: This is not new. The difference between an entity and a value object is that an entity has an identity. The data of an entity can change over time, but its identity never changes. For example a person can change their name, move to a different address, but it's still the same person. A value object doesn't have an identity. When the value changes, it's a new object. For example '$2' is a value object. It has a currency and an amount. If you change it to '$3' it's now a different object.
  • Factories: Factories create new domain objects. As you can imagine, creating a new domain object could involve multiple steps. For example in TempHire, creating a new StaffingResource involves three steps and additional data needs to be retrieved from a repository in between. Over time you can imagine that we may have different types of StaffingResources and each one involves different steps to create it.
  • Repositories: As opposed to the simplified approach, repositories don't save. The main responsibility of a repository is to retrieve domain objects from the underlying data source. It becomes more obvious why this is important when you have multiple repositories participating in a workflow. Which repository should save the changes at the end? The answer is none.
  • Services or Domain services: Domain services contain stateless business logic that is performed on the domain objects. They use factories and repositories to implement a particular process. For example transferring money from one account to another. Such a transfer service could use the account repository to retrieve account 1 and account 2 and then modify both accounts accordingly. TempHire currently doesn't have any domain services.
  • Unit of work: The unit of work brings all the above together. It represents a single workflow instance within your application. It's main responsibilities are tracking changes and committing (saving) or rolling the changes back at the end. This answers the question of who does the save at the end of a workflow. Thanks to DevForce, implementing a UoW is actually very easy, because the EntityManager already does most of it. The UoW also exposes the Factories, Repositories and Services correctly configured so they can all participate in the current workflow.

Hope this helps.

 
 


Edited by mgood - 01-Apr-2012 at 9:40am
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2012 at 6:02am
Thanks again! By the way, just in case you're not aware, it'd be nice to be able to download the latest version of Cocktail and run the sample applications out-of-the-box. However, at the moment all the project references to Cocktail and DevForce all go to pot.
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2012 at 9:01am
Also, in the StaffingResourceManagementViewModel.cs, there is a _selectionChangeTimer being used, could you go over why it's needed?
 
I think it's to ensure that the two view models stay in-sync with the selected item, but is there really no better way of doing this?
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2012 at 10:23am
Originally posted by Siyfion

Thanks again! By the way, just in case you're not aware, it'd be nice to be able to download the latest version of Cocktail and run the sample applications out-of-the-box. However, at the moment all the project references to Cocktail and DevForce all go to pot.
 
The latest version of TempHire utilitzes NuGet Package restore to automatically download all references except for DevForce. Unfortunatley, DevForce currently needs to be installed, but we are working on this.
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 02-Apr-2012 at 10:33am
Originally posted by Siyfion

Also, in the StaffingResourceManagementViewModel.cs, there is a _selectionChangeTimer being used, could you go over why it's needed?
 
I think it's to ensure that the two view models stay in-sync with the selected item, but is there really no better way of doing this?
 
It's actually mostly to save unnecessary roundtrips to the server. If you cursor up/down fast, I don't want to load intermediate selections until you come to a rest long enough.
 
But, what you think it was doing is not completely wrong. Unfortunately with the asynchronous nature there is the issue of the data arriving in a different order than it was requested. So, if you select things in fast order you could have the issue of the wrong selection being loaded at the bottom. The only clean way around this is to associate a sequence number with each query and throw away the result if the sequence number is older than expected. I haven't bothered about this just yet in TempHire and with the selection delay it's less of an issue.
 
 
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2012 at 1:20am
Originally posted by mgood

The latest version of TempHire utilitzes NuGet Package restore to automatically download all references except for DevForce. Unfortunatley, DevForce currently needs to be installed, but we are working on this.

That's weird, I thought that but my colleague didn't seem to have the option available to him when he right-clicked on the solution, however, on mine (I've *just* tried it) it works fine... However when building I do get two errors (WPF):

Error 1 An error occurred during metadata generation and a metadata file could not be created.  Error: A connectionString was not found. Please see the DevForce Resource Center 'Advanced Database Connections' topic for more information. Since SQLExpress is not installed DevForce metadata discovery cannot continue.  Add a .config file with a connectionString named 'TempHireEntities' to this project.  Providing a connection string at build time ensures that the correct model metadata is generated. DomainModel

Error 2 An error occurred during metadata generation and a metadata file could not be created.  Error: A connectionString was not found. Please see the DevForce Resource Center 'Advanced Database Connections' topic for more information. Since SQLExpress is not installed DevForce metadata discovery cannot continue.  Add a .config file with a connectionString named 'SecurityEntities' to this project.  Providing a connection string at build time ensures that the correct model metadata is generated. Security

Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2012 at 2:48am
I'm not sure what option you are looking for. NuGet package restore has already been enabled on the TempHire solution. You don't need to do anything for it to work. It's added as a build target to the project files.

Your issue is because your system doesn't meet the stated prerequisits for Cocktail. You need SQL Express installed and running if you want to run the samples unmodified. The error message tells you exactly what the problem is. If you don't have SQL Express installed, Entity Framework doesn't know where to create the database. 

You'll have to replace the following two connection strings with your custom connection strings if you don't want to install SQL Express.
  <connectionStrings>
    <add name="TempHireEntities" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TempHire;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    <add name="SecurityEntities" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=TempHire.Security;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
  </connectionStrings>
 


Edited by mgood - 03-Apr-2012 at 2:50am
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2012 at 3:07am
A simple re-build doesn't seem to trigger the NuGet package restore, I had to manually right click on the solution and click on "Enable NuGet Package Restore" in both the Silverlight and WPF solutions. Which, for some reason my colleague didn't seem to have (although we may have just missed it).
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2012 at 3:32am
If you want to trigger a fresh package restore you simply blow away the packages folder in the solution directory. You must have had an older packages folder that looked like all the correct packages were already downloaded. Package restore doesn't download the dependencies from NuGet every time. It only does it if the required packages are not found in the packages folder. The "Enable NuGet Package Restore" simply addes build targets to the projects. If you have old files left behind from a previous version of Cocktail that could screw you up.
 
Best is to start clean. Blow away your current Cocktail folder and unzip fresh. Don't unzip over an existing Cocktail, or you'll be left with stuff that should have been deleted.
Back to Top
Siyfion View Drop Down
Groupie
Groupie
Avatar

Joined: 22-Mar-2012
Location: Bristol, UK
Posts: 47
Post Options Post Options   Quote Siyfion Quote  Post ReplyReply Direct Link To This Post Posted: 03-Apr-2012 at 7:07am
Weird, I didn't see him install the new v05 package on his machine so for all I know he may well have overwritten the old with the new... We'll go with that for the time being anyways! ;)
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down