This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have downloaded Lightspeed today to evaluate your product and have several questions and concerns. First, your Getting Started screen casts is great when you have a database available. But, from a domain driven design view, this does not help at all. What I'm looking for is to be able to create a domain model first and not a datatabase first. I do not see how one can use a model first approach. Since the SimpleDB connection is not working either, I cannot test any Lightspeed functionality. Second, what scared me to see in the Getting Started screen cast was that I saw partial classes being created and the "functionality" or "behavior" part of a class was barely mentioned? The behavior of a class is extremely important. This is where the business knowledge resides. The whole point of domain driven design or object orientation is the capture the domain knowledge and being able to maintain it efficiently. The screen cast in my opinion showed nothing but value objects or glorified data objects. Can you clarify or point me to a screen cast that is from a domain driven perspective instead of the old database point of view? Thank you, |
|
|
Hello Thomas, To use a model-first approach, open the Visual Studio Toolbox and drag entities, value objects, associations etc. from there. To create the database from the model, click the model background, go to the Properties box, enter a connection string and data provider and then right-click and choose Update Database. You are correct that what the designer generates is the "dumb" data object part of the class. Obviously the designer can't know about your business logic. However, you can add that business logic through your own part of the partial class. That is, create a partial class via the Add > New Item dialog or by right-clicking an entity and choosing Refactor > Create Partial Class; then add your own methods or behaviour in that partial class. If you need to inject domain behaviour around the "dumb" data properties, you can do so by changing the property's Generation option to FieldOnly (which causes the designer to generate only the dumb backing field) and writing your own property getter and setter (into which you can inject domain logic as required) in your part of the partial class. We don't currently have a screencast demonstrating model-first, but I will chase up our screencast guy to see if he can make one -- thanks for the feedback! |
|
|
Forgot to mention -- the Update Database feature is not available for SimpleDB (basically because SimpleDB is schemaless so it wouldn't actually do very much). |
|
|
Hi Thomas, Good question, to add to Ivans replies, there is one sample which demo's the guys adding business logic to a partial class. In this directory you'll see the guys broke down the model.cs into separate classes: C:\Program Files\Mindscape\LightSpeed\Samples\Store\Web\Model\ (I want to know if there a way to do this via a setting rather than manually) Then in this directory you'll see some business logic added: C:\Program Files\Mindscape\LightSpeed\Samples\Store\Web\Model\Extensions Cheers |
|