An Entity Framework equivalent for .Net Compact Edition? - entity-framework

Since Entity Framework does not run in .Net Compact Edition is there any compatible alternatives I can take a look at?
*I'm especially looking for something I can use on Windows Mobile 6.1.

Depends on what you mean by "compatible". You mean a compatible object model? Nothing that I'm aware of, but then EF is huge and if you found something it would probably perform terrible anyway. If you're simply after an ORM that can be used on multiple platforms, the OpenNETCF ORM works fine under Windows Mobile and Windows desktop (plus Mono for iOS and Android to boot). In fact it was first written for Windows CE, so it works rather well for WinMo.

Related

Script hosting in .Net 4.5

We were using IronRuby in our applications for some simple scripting of biz logic and rules.
We are trying to upgrade everything to .NET 4.5 - and our ScriptRuntime/IronRuby code is not happy with that. It does not lok like IronRuby has had a lot of traction lately, so we are wondering what would be a good scripting engine to switch to that is best supported by a .NET 4.5 environment. We prefer simple - the less third-party stuff we have to bring in the better. OUr scripts are also simple - not a big effort to convert.
Suggestions?
If converting your scripts to C# isn't a problem, I would recommend looking into the Microsoft "Roslyn" CTP and its Scripting API.
Because the .NET compiler developers are currently rebuilding their compilers in the Roslyn architecture and the Visual Studio team intends to consume the Roslyn compilers in the future, it's a safe bet that support for this scenario will remain for quite some time.
If you're not looking to consume the Roslyn architecture, you could also leverage Windows PowerShell by writing a custom host application that can execute PowerShell scripts that contain your business logic.

Play 2 Framework code generation tool or Yii/Cakephp frameworks?

I'm trying to get started with a couple of web applications. However, choosing a framework to work with can be overwhelming!
I've worked with Java in the past, and since I do C# .NET at work, I don't mind learning and extending my Java knowledge. Now, the only framework that seems to work without jsp and other applet things that I've never understood is Play 2 Framework. I downloaded this framework, put the executable file in my path, and it seems that it would work for me. However, I came across CakePHP and Yii frameworks (I'm sure there is more) and notice there is a code generation tool that gets the database and automatically generates the models for you + the CRUD and such. Geez that is a save of time.
I went and googled my question and got that this is also possible in Play Framework (bummer only found the module for 1.x framework.)
How to quickly generate models in play framework 1.2?
http://www.playframework.org/modules/db
So, my question is...
Is there a module that would easily let you do this work in Java Play 2.0 Framework as in the mentioned PHP frameworks?
If no, would it be worthy (any advantages) to stick to the Java Framework?
If no, what php framework or even python (but Ruby) framework you consider has the best tools like this auto completion feature? I don't mean learning a new language, I will have to anyways. But rather to learn a language I can do things other than web development (for Ruby I know you can do more stuff but it might be just a waste of time to learn that other language. However, learning Python, Java, would open up app and phone development as well)
Don't mean to open a debate, please be concise (not like me) in your answer. Thanks!
From personal experience, there's several difference in both frameworks, particularly the way models are handled in cake vs yii.
In cakephp you cannot use composite primary key, this is the main deal-breaker for me. Composite primary key is supported in Yii.
Cakephp enforces convention, while yii favors convention, you are not forced to follow a certain standard.
Out of the box performance, I think yii has the advantage, but as with performance tuning, with proper cache configuration, and as long as you are careful in using the ActiveRecord patterns, they are not that much apart
As a side note, I have lead web app implementation with both CakePHP and Yii, the feedback that I got from the team was that the less experienced team preferes CakePHP, while Yii is preferred by the more experienced team. Make of that what you will.
Well it can turn out to be a very long debate. Each has its own life. So far from Experience I have found Yii to be most promissing than everyone. For me it matters who gives more work in less time. Cake is a bit heavy but Yii is light weight framework. I am from .Net Background but it took mew few weeks to get going with Yii

Mono + Entity Framework using MS DLL?

I know Mono has no EF implementation, and no plans to create one.
Would it be possible, however, to simply take the relevant DLLs from .NET and add them into my Mono project in MonoDevelop? I may be completely misunderstanding how this is supposed to work; but wondered if this would then allow me to continue using EF + Mono rather than replacing the ORM.
Thanks.
For the Entity Framework on Mono status, see the mailing list post.
For the legal status, see Entity Framework license agreement. You are licensed to run Microsoft .Net on any legal copy of Windows, not on other operating systems. So even if this was technically possible, it would not solve your business problem. If you think now "what about ASP.NET MVC?" or something like that - those products are released by a different team and come with another license agreement that is much less restricted.
Since version 2.11.3 mono includes entity framework functionality.

Is there a .Net 1.1 compatible String.GetHashCode implemented in .Net 2.0 code?

I have an existing app in which I made the mistake of using String.GetHashCode and persisting it to disk. Now that I'm upgrading the app to .Net 2.0 I find that that decision has come back to bite me in the butt.
I'm interested to know if anyone knows about a .Net 2.0 implementation of a .Net 1.1 compatible string hashing algorithm.
Obviously the best solution would be to buy myself a time machine and go back to 2002 and kick myself in the shin for even considering using the hashcode this way. Since that doesn't appear likely I'm looking for a workaround. I have existing users with this data on their systems so it's not possible for me to make one big conversion of the hashes or anything like that.
With the change to 2.0 I will update the code so it uses MD5 or SHA of course.
I considered extracting the String.GetHashCode source from Mono but since Mono is GPL and my app is commercial that really isn't an option. I don't even know if the Mono implementation is compatible with the MS .Net implementation since the contract for GetHashCode wouldn't require it to be compatible.
Any ideas?
You're not the only one, it seems: Getting .NET 1.1 CLR String Hash Codes In The .NET 2.0 CLR
That links to BackCompatibleStringComparer, which (allegedly, I can't verify) shows the implementation of the old GetHashCode().

Help me convince higher-ups to allow switching to .Net 3.5 (from 2.0)

I have been sold on the fun of using linq in areas other than pure database interaction. (See Calling fellow code nerds - Alternatives to Nested Loops?).
We are stuck on 2.0. I have told the powers that be about the ease of updating to 3.5 (we have already migrated to VS2008) but they are wanting a list of "benefits" for upgrading.
Can those that have experience in 3.5 help provide some talking points for the benefits of updating an existing app to 3.5?
UPDATE: Found an additional reason: Microsoft's inclusion of Charting tools for Asp.Net as a patch on top of 3.5! They get their business value, I get the fun...
Can YOU make a case for it? Sounds like you want it because LINQ is fun. Other people are mentioning features that are fun. I've always had a problem selling fun features to management because they aren't very compelling reasons to potentially disrupt an environment.
Honestly, it really depends on what you are using C# for. Are you a web developer, system admin, something else? Taking a general approach, I would use the following selling points (you will need to do some work to prove these things):
Zero-disruption for end-users when upgrading. Upgrading to the new version will be seamless and we will have a thoroughly reviewed test plan for updating all clients to this version. All of our old applications that require .NET 1.x or .NET 2.0 will still work perfectly.
Programmer Efficiency. You could mention how more of the Windows API is wrapped by .NET classes, thus making programmer more efficient because they don't have to P/Invoke as much. LINQ makes your more productive because of x, y, and z. Lambda expressions make you more productive because of x, y, and z.
Ease pains of future OS migration. Moving to WPF now will prepare us for Vista/Windows 7. We won't have to migrate applications using the now deprecated "Windows Forms" to WPF, because we will already be using it.
More applications purchased from 3rd parties will require it, so we will have to upgrade sooner or later.
In the end, you need to prove that at the very least, this move will not cost you money in terms of increased support or testing costs. If you can show it will make you be more productive and it will be a rather painless switch, then you will get your wish.
Maybe you should talk to some Java developers who are probably still forced to develop using 1.3 or 1.4 despite 1.5 being out for over 3 years and 1.6 for a couple... it appears platform consistency across the business is often of greater importance than the benefits of using the latest and greatest.
Also remember that 3.5 is just additional BCL libraries. You are still running on CLR 2.0. Same is true for 3.0. Usually when people find out that the underlying framework is the same and that you are just adding in new libraries they are more likely to go along with it.
You don't need .NET 3.5 to get LINQ or C# 3.0 features. You can implement your own LINQ for .NET 2.0. I am using C# 3.0 all over the place in my .NET 2.0 application. I don't know the full details on how to start the conversion process because I didn't set it up myself. This might be a good link for you: http://www.danielmoth.com/Blog/2007/05/using-c-30-from-net-20.html.
http://msdn.microsoft.com/en-us/library/ms171868.aspx
Transitioning onto 3.5 would help you reap the benefits/ features of:
LINQ to (Entities/ XML / Objects / Datasets etc ).
WCF, WF and WPF.
ASP.net MVC where MVC is kind of a de facto standard in other
platforms like Ruby/Python which
allow you pure HTML/ Javacript based
development.
ORM options with ADO.net Entity
Framework/ Linq to Sql
4.
With a few addons you can have
support for dynamic languages
like
IronPython/IronRuby.
Oh ya I almost forgot ADO.net Data Services..one of my fav.
These are the few benefits that immediately come to my mind.
In my experience, the addition of LINQ and Extension methods alone have made many previously arduous and/or time consuming tasks much easier and faster. The increased developer productivity from that alone is worth the upgrade effort IMHO.
Lambda expressions are awesome. There is no end to the places where I find that lambda expressions help me out in a very concise and readable way.
Automatic properties, while being a simple concept, really help making the code base smaller and clearer.
Also, I sencond the extension methods.
Before I even opened this question I had my answer: LINQ - it's one of the greatest extensions ever in .NET - I love it. It took me a few days to figure out, but now I've got it, I use it all over the place. The ability to query collections and arrays is worth the upgrade alone in my mind.
Decreased development time (and therefore increased ROI)
Less time wasted finding workarounds for .NET bugs that've been fixed in newer releases.
Extension methods for native types (in a similar fashion to JavaScript prototyping)
LINQ extensions - they take a couple of days to get your head around, but it's awesome!
LINQ to XML makes working with XML so much simpler
LINQ to objects/collections
A nice new 3.5 poster from Microsoft that you can pin up in your cubicle.
As a manager if I have a happier more productive team that is producing more in less time, then its a no brainer.
Ask yourself this: Will the developers be more effective and will their increased productivity actually increase benefit to the company or reduce corporate costs once you've considered the upgrade/transition/installation on the servers/additional testing etc? If the answer is truly yes, then do the upgrade and quit arguing about it.