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
|
Hi, I’ve downloaded a copy of the LightSpeed nightly build and taken it for a quick test drive. All up, I’m pretty impressed. The code it generates is simple, yet offers a reasonable amount of features you’d expect from an ORM. I had some feedback and a few questions that I’d like to offer: (Note, I tested against an MS Sql 2005 instance, my notes might not be applicable for all providers) * I'd like to see the generated output from the diagram be one class per file. This is probably a matter of personal preference and might be better suited to a user settable application option. * How exactly does the concurrency checking work? I couldn’t get it to generate a concurrency exception. It appears that the last update in wins. It would be nice to be able to specify my own concurrency predicate to take advantage of timestamp fields rather than the MS way of checking every field in the current object against the database before issuing an update command. * Are updates smart enough to only update columns that have changed? * Don't sort my column / properties names when dragging a table onto the LightSpeed design surface. I group all fields logically when I create the table, having them reorganised is annoying. * I’d like to see a ‘MyEntityFields’ enumeration generated for each entity so as to remove reliance on strings: _uow.FindOne<MyEntity>(Entity.Attribute("MyColumnName") == "SomeValue" could then also be written as: _uow.FindOne<MyEntity>(Entity.Attribute(MyEntityFields.MyColumnName) == "SomeValue" Keep the string overloads as well, sometimes they are useful ;) * Any plans on adding support for udf's / stored procedures? If so, it would be nice to be able to define where these are placed. Ie. you might want some in a generic 'util' class, or you might want to attach one as a method to an entity if this makes more sense from a business modelling perspective. * Generated SQL should [square].[bracket] table and field names to avoid conflicts with reserve words and names that contain spaces. * When dragging a table onto the model surface I think you could make an intelligent guess as to what the 'Identity Method' property should be based on the table meta data. A small point, but it would save having me having to update this property for all my tables as by default it appears to use the 'Key Table' method. Overall, nice work! Cheers,McOz
|
|
|
/e slap WYSIWYG editor keeps dropping out my line breaks :(
|
|
|
Hi, Thanks for the feedback. I will answer a few in line. [quote user="McOz"]How exactly does the concurrency checking work?[/quote] LightSpeed uses row versioning. This is enabled for a model by including an integer field called lockVersion. Update statements then include a version number check. [quote user="McOz"]Are updates smart enough to only update columns that have changed?[/quote] No, we may add this feature but not many people have asked for it. [quote user="McOz"]Generated SQL should [square].[bracket] table and field names to avoid conflicts with reserve words and names that contain spaces[/quote] This can be enabled by setting QuoteIdentifiers on LightSpeedContext. [quote user="McOz"]When dragging a table onto the model surface I think you could make an intelligent guess as to what the 'Identity Method' property should be based on the table meta data[/quote] IdentityMethod is usually only specified once on the LightSpeedContext. Model level IdentityMethod support is only for overriding the default and is a new feature. Cheers, Andrew.
|
|
|
Hi, McOz, Thanks for the detailed feedback! * Making the generated output one file per class instead of one file per diagram. This is a Visual Studio limitation unfortunately. In fact the command line tool, lsgen, does create one file per class. You might be able to put together a build chain in which you create the lsmodel using Visual Studio, then feed that lsmodel to lsgen to get the C# or VB files out (instead of using the VS-generated file), though I'm not sure how worthwhile it is given that you wouldn't normally be looking at the generated code. * Are updates smart enough to only update columns that have changed? Yes. The updater analyses the model against the database, and only adds, drops or changes the type of columns where it detects a difference. You should be able to look at the generated DDL statements in SQL Profiler if you want to review exactly what we change. [Oops, I see from Andrew's response that you were probably talking about data updates -- this response applies only to updating the schema using the designer. Sorry!] * I'll look at that field sorting behaviour you mention. As far as I know we are generating the columns in the order that SQL Server gives them to us, so there may not be much we can do about this; and in our own test suite I don't recall having seen the fields being sorted when dragged on. I'll double check though. * I like the idea of generating constants for use in Entity.Attribute and will add it to the wishlist. We'd probably just make these constants of string type rather than an enum though. * The IdentityMethod in the designer should be defaulting to Default, not to KeyTable. This means that the identity method for that table is specified in the LightSpeedContext. So normally you will just set LightSpeedContext.IdentityMethod (which does indeed default to KeyTable) and forget about per-table identity methods. You would only set an IdentityMethod on an Entity if that table had a different ID type of strategy from the other tables in your database. Sorry this was confusing -- hope you'll find it a bit more convenient now! |
|
|
Cheers all for the speedy replies. I'm working on a personal project at the moment (less than 8 entities) so I'll keep reporting back anything I find. If my personal project goes well, I'll see what I can do about buying a license for my next company related project. So far - i've not encountered any showstoppers, keep up the good work. |
|