Active Directory User Management with F# [closed] - f#

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have been looking into F# for quite a while now in between projects at work, but never really had the guts to start using it in any of them. Usually just fall back to C# when working with .net.
I am currently planning an automated user management application, basically CRUD between a database and Active Directory. I am at a point where I am willing to use F# as I believe that data handling would work much better and I won't have much of a GUI, only a logging interface in the background.
My question is at this point if anyone with prior knowledge to F# would advise me to go full throttle with this language for a project like this. I am not asking if it is better or not to use the language itself, but if it is advisable as is, or better to just plug in some scripts here and there. Or if F# is a no go for a project like this especially for someone who had a term of Scala and only wrote some math functions in different ways possible in F#. This project has a dead line, too.
Just afraid that if I don't start using the language in a real project soon that i never will.

In fact, my first production (in professional capacity) F# code bits involved querying Active Directory and stuffing the results into a SQL Server database. It worked out very nicely, so I say go for it!
Some pleasant points I remember:
I created some F# record types to project raw ldap results into... pattern matching on the record types was a boon.
I implemented an implementation of the dynamic operator ? for accessing the properties of the ldap results in a less stringy way.
I used SQL Server's bulk copy ADO.NET feature for efficient large inserts of ldap into the database. F# allowed me to create clean, easy abstractions that hid some of the ugliness of the raw ADO.NET API.
I implemented these backend F# bits in a standalone project which was consumed by a C#-based APS.NET MVC project (mostly to push a button to execute some action). Interop with C# was pretty nice (I did have to expose a more C# friendly API, if I recall, but it was simple and easy).
F# interops with .NET APIs like a champ, so no issues there with the ldap API
F# is fun and reduces defect density!

I myself, would definitely give it a try, as the code seems to be very maintainable even by people who do not have deep knowledge of F#.
My opinion might be slightly biased, though, as I very much like F# myself. But I did have the opportunity to introduce F# at work to my team of C# developers, who had had no F# knowledge at all.
We started off with a few coding dojos, where after a quick language intro, the team managed to write more unit tests and complete more of the coding kata, than ever before in C#, even though they are new to F#. And this consistently over the last four coding dojos now.
Also we rewrote our build scripts in F# - we had used powershell scripts before. And this encouraged us to go way beyond the complexity of the old build scripts. And it is a fact, that the team now feels like the code is very maintainable, even though they have a limited knowledge.
Actually, it has been such a successful endeavour, that we are now putting real thought into writing some imporant core components in F#.

Related

Why use Node.js if I don't require real-time functionality? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm considering using Node.js with a framework such as express, meteor, or sails (a directory with social features such as sharing, messaging and uploading media). I don't have any features planned that explicitly require real-time functionality, so does it make sense to use Node.js anyway instead of Rails?
There's so much buzz around Node.js that I am tempted to use it just so that I don't get left behind.
As DHH wisely noticed regarding Node vs Rails, "everything can be used instead of everything else". That's somewhat true in a sense that, for example, a site in Rails with promptly set up caching can be as fast as one written in Node.js.
Besides, Node is not necessarily about real-time. It's more about being able to handle many light (in terms of processing time needed) requests. If you expect high level of concurrency (I mean, really, expect, not just are dreaming of it) and every request is supposed to be relatively small, then you could consider using Node, just because handling bigger load (up to some point) will require less work with Node.
Bottom line, use what you are good at. Unless you want to try something new. And Node.js is definitely worth trying.
You're question does lack quite a bit of context.
This question all depends on the context.
If this is contract work or something you want to make money with in the near future and you're not sufficiently skilled with any of the mentioned nodejs frameworks.
Then I would recommend you use whatever you're already good at.
If this is a private project for fun or any other non serious purpose.
Then I would seriously recommend you to try one of mentioned nodejs frameworks.
In my opinion nodejs is currently the cutting edge web technology. As a developer
you should always try to stay on the cutting edge. That way when you learn how nodejs can be used you might find ways to use those things in your professional environment.
I've lately been using meteor a lot and I can highly recommend it, once you get the hang of it you can do truly amazing things that you could never even imagine doing(in a reasonable timespan) in a classic php project.
Also according to some meteor will replace RoR alltogether blog
Aside from real-time, main plus I've seen is having same team being able to develop JavaScript client code and server side code for UI web applications. "Code sharing" between client and server seems a pipe dream to me, but same language is really nice.

Looking for open source Delphi project with good unit test coverage [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
For educational reasons I am looking for an open source Delphi project with good unit test coverage. Projects which are under Test Driven Development are preferred. The size of the project doesn't matter.
Subject should be business or game development, but no web projects.
Any hints?
Edit:
Thanks for the suggestions, but I prefer projects where the requests come from "normal" users, not from programmers like for a CRM or ERP system. For example, a task planner or jump-and-run game. Has anybody seen something like this?
Take a look at DeHL. It makes heavy use of generics, and the author has an extensive test suite to make sure that the collections will work properly and not break the compiler.
We tried to implement test driven development for all root classes of our ORM Framework.
All low-level (numerical or UTF-8 text conversion) and high-level features (RTTI, ORM, JSON, database, client/server) were tested before their implementation.
We even made some basic regression tests about the encryption or pdf generation part.
And the tests were then inserted into the main documentation of some medical project (to follow the IEC 62304 requirements). Every release triggered more than 1,000,000 unitary tests. Then manual tests (human-driven on real hardware with working robotic workstations) were performed. Those high-level tests were written using the same documentation tool, which generated a cross-reference matrix to track that all tests passed before any release.
Perhaps not a perfect match, but at least a real use case, in a real world Delphi application, developed for the medical area (and if you know about FDA regulation, you know what I mean). :)
See this article in our forum.
Delphiwebscript boasts about their coverage: http://code.google.com/p/dwscript/
I recommend DeHL.
From its introduction page:
DeHL is an abbreviation that stands
for Delphi Helper Library. DeHL is a
library which makes use of the newly
introduced features in Delphi 2009;
features like Generics and Anonymous
Methods. It tries to fill in the gaps
in the Delphi RTL by providing what
most developers already have in other
development platforms.
IIRC tiopf has a large testsuite.
Free Pascal maybe even has a larger one, but it depends if that can be regarded Delphi enough for your purposes (3860 tests that pretty much pinpoint "Delphi, the language"). They have their own unit testing framework "fpcunit"
I can recommend JediCodeFormat & DelphiCodeToDoc.
Both are open source projects with many automated tests build with DUnit framework.
I think instantobjects is good place to study. This is one of the best OPF in delphi.It also contains unit test built with DUnit
OmniThreadLibrary also has a lot of tests
http://otl.17slon.com/index.htm

Embedded language: Lua vs Common Lisp (ECL) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Does anybody here have a experience with Common Lisp as a embedded language (using ECL)? If so, how good is ECL compared to Lua?
I haven't embedded CL before, but I've done it with both Lua and two particular Scheme implementations (Gambit-C and GNU Guile).
Scheme makes a great embedded language in my opinion, because it is flexible and not too bloated. Gambit-C is particularly awesome for this because it allows you to both run interpreted scripts, and also compile your code down to C. In my tests, Gambit-C's generated C code was only a little slower than handwritten C (for example, a particular test that ran 0.030s in C was 0.040 in Gambit!). Gambit also has a really nice FFI (foreign function interface), which is essentially just Scheme with special syntax for writing bindings to C libraries (ObjC and C++ are directly supported also). Gambit also has a very nice repl with some debugging capabilities.
Guile is also pretty nice, and it actually runs faster than Lua (fastest interpreted language that I currently know of -- Guile has made great progress in recent years). But since Gambit-C can compile to really fast code, I generally don't use Guile as much unless I intend to use interpreted code in the final version.
Lua has closures, but you won't get continuations like in Scheme, and you also won't get the macros. It's still possible to do a reasonable amount of functional stuff though. It won't have a fully featured object system (like CLOS in CL), but it does have tables and they can be used to implement both class-based inheritance and prototype-based inheritance quite easily. Also, Lua has an excellent C API that is really a pleasure to work with. It's stack-based, and designed in a way that you don't have to worry about the Lua side of memory management at all. The API is very clear and well organized, and there is a lot of great documentation and example code out there. Lua can't compile down, but it does use byte-code (always -- when you send code to the Lua VM, it always compiles that code down the byte-code first and then runs it).
Now, as for Common Lisp, I think that it would probably not make a very good language for embedding. The reason for this is just that CL is huge. Generally, it's desirable to embed a lightweight language because it's going to be using the platform/libs that you provide to it, and not so much external stuff.
So, I think you can't go wrong with either Gambit-C, Guile or Lua. They'll all really nice. CL is powerful, but I just think it's too big for embedding.
I can only agree that Lua is terrible. It works well when you have a pure imperative functional programming style but not if you try OO with large hierarchies, for example NEVER try to wrap a typical GUI toolkit like GTK in a Lua hierarchy, the performance will be just terrible.
I still use Lua because it's so lightweight that you can have dozens of interpreters running at the same time and end users understand to write code snippets with it while Lisp/Scheme has an expert only (lack of) syntax.
I would now add that mruby 3.0 is out and a great language to embed. Unfortunately in the meantime everyone went Javascript and Javascript only.

Best Practice in Delphi Rapid Application Development in term of Reusability [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How to improve our productivity when starting new project using Delphi?
For me, I create a template project including splash screen, primary data module with default component and all data-aware subroutines (open, close, query, default when failed to open DB, etc), and save the template in my repository. (I use all my own frames and unit in the project, so everything always be created automatically when I choose : New Project and choosing my template.)
Questions:
Is there any other way to improve reusability using Delphi?
What free open source framework (like Jedi) / IDE PLugins (like GExpert) you think is best to use using Delphi?
Pardon me if this question has been asked before.
For Q1: Use mature libraries which do for you the grunt work: DevExpress -or- TMS for UI (JEDI's JVCL also is very good), FastReport for reporting. Choose also a good connectivity framework (it depends on your db back-end) in order to have many day-to-day tasks solved OOTB. Also, if you're familiar with OPF have a look at InstantObjects. I heard that's very nice.
For Q2: See the IDE enchancements from cnpack.org
Also it will help to slowly build your own specialized framework/set of tools. Not something very big but as a quick way to get some things done in your way. Always try to design for reuse, even if it takes a little bit longer in the beginning.
For larger applications, the key to productivity is to work at a higher abstraction level than data module and database.
The database has a small set of types. In your domain you are likely to have default mappings from domain types to database types. You'll also have validators and formatters for them.
You'll have default reports, filters and search (windows, panels, sql queries) for your domain entities. You'll have role-based access control to them.
Take a look at domain-driven development.
One of my big gains in reusability in recent years has been moving to an ORM layer (I use tiopf) to separate out my business objects from the database.
As an example, I have db persisted, background threaded email objects. To add them to another application, I add in the required units and add a few lines of configuration (table/field mapping). Similarly I have user objects, generic lookup lists and the like all of which can be added to different projects for the price of initial configuration. This works on different databases without any changes other than configuration.
tiopf is my ORM of choice (read my overview here) but there are numerous others.
Defining the exact range of applications you want to make is a good first step. Improving productivity is nearly always related to specialization. General tools is just an extremely small percentile of productivity. I'd rather search (or make) specialized frameworks in my line of work if I really wanted to boost productivity.
I don't use GExperts, or another plugin. I don't benefit greatly (being able to grep just fine on the cmdline) in productivity, and any crash that can be avoided due to problems in the plugin is then a pre.
I used ModelMaker with Delphi. It is really nice tool that lets you draw objects and then can generate code based on templates you write.
It can speed up things when there is number of similar classes in project.
For Q2: GExperts is useful. The grep search comes in particularly handy, although the search / replace can cause odd side affects (inserting characters it shouldn't!).
I know you mentioned free / open source, but Castalia is very good. The refactoring methods work well and I like the structural highlighting, which makes it much easier to work with code (I did originally use CodeRush for this but it went Visual Studio only). The Bookmark stack is also handy for quick going back and forth through code.
Also, if you are a team, look for ways to improve your development process. Besides using Delphi as your implementation language, what are your project management methods? What source code management system do you use? What is your build system? Do you use automated testing methods? etc.
When I introduced Scrum at a previous employer, we got an almost immediate 50% improvement in team productivity. So check out the various Agile methodologies.
For true reusability, try to think in interfaces and try to black box as much as possible. Patterns are everywhere, research them and put them into practice.
When dealing with objects, as much as possible use the abstract, or an interface rather than a concrete implementation. Just be careful of taking this too far. Too many abastractions can add complexity and make debugging harder.
Units containing your business rules should be used by your gui. Units containing business rules should never themselves directly use gui units.
When I ask questions like this about "what is the best thing to do or to use" they are quickly removed from the site by the moderators.
In my opinion, you are right to use the sample template. Also #John Thomas is correct. But you can go beyond:
Use a template for database procedures and functions to work with requests;
Try to put the most of the database logic inside the database using stored procedures and functions. This way you don't have to worry about selecting what is common use and what is specific to current project;
Use a template for main menu and main screen;
Instead of crating many windows, create one TFrame for each module of your application and reserve a place in the main screen to load them. Create an object of this frame in memory only when the user clicks it's menu. This way, your system gets faster and more memory economic;
Reuse those frames by creating base frames with the common functionality and layout and them create new frames descendants from it.
Just great!

What are the coolest Ruby on Rails features, why choose it? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Before I asked this question I had a look through the search results for 'Ruby on Rails' here on SO. Couldn't find much, but the following (found on this page) amused me
Personally, I started using .html, moved onto php, tried ruby (hated it), discovered Python / DJango.. and have been happy ever since.
Now here's the deal. I have no personal intention of learning Ruby on Rails just yet, but it's the topic of a group presentation I am to do at the Uni (and my mates chose the RoR subject). People with a grudge against students asking homework-type questions should leave immediately.
This question is for RoR people who find it great. I hope to find those that claim RoR is the best (authors of the breathtaking testimonials to be found at RoR website). What makes RoR so outstanding? What would you like the youths of today to find out about it just before they leave the Uni with a degree. Try suggesting something that could root in their minds and perhaps navigate them the RoR way after leaving Uni.
Your answers will not only help my presentation, but could be the source of enlightenment for many.
ActiveRecord's dynamic finders:
Person.find_by_name_and_company_id('Jorge Luis Borges', 42)
rjs, writing javascript in ruby:
page['element_id'].insert_html :bottom, :partial => 'comment'
ActiveRecord's scoping
class Shirt < ActiveRecord::Base
named_scope :red, :conditions => {:color => 'red'}
named_scope :dry_clean_only, :joins => :washing_instructions, :conditions => ['washing_instructions.dry_clean_only = ?', true]
end
calling Shirt.red will query the db with the "color = 'red'" condition
the cool part, is that if you combine more than one scope eg:
Shirt.red.dry_clean_only
it will build just one query, with all the conditions and joins necessary to satisfy both scopes.
ActiveRecord's Migrations, being able to manage db structure and data using active record, just like in the app's code, with minimal sql usage.
Tools are about solving problems. It doesn't matter whether you're talking about the tools in a wood worker's shop or a programmer's. What impressed me about Rails (and still does) is that it was extracted from framework used to build real-world web apps and has repeatedly been improved by people who extended or changed it after using it to build real-world web apps. It was no mere academic exercise.
Some of the specific problems it addressed:
Getting started quickly. If you are looking to get a web application underway quickly, what better choices could you have than a framework that specifies an existing directory structure (one based on MVC), with lots of code generators, and choices already pre-made for you as to components like JavaScript library, testing support, ORM, etc. You may not agree with all the choices but you can assume them and have something that will work for 80% or more of projects and swap out something later if you have a preference.
Long term maintainability. Migrations give you ways to move data forward as your code changes, something that happens in any real-world application, yet most frameworks do not account for that at all. Separating all of the parts of your application into a directory hierarchy already setup with areas for testing, database, configuration, etc. again aids the long term maintenance of your project.
Reduced human error. Configuration files give you extra opportunities for human error. Logical conventions, once learned can avoid mistakes like the classic mistyped file name or class name in a configuration file error.
Recognition of different modes of development. Rails has built in support for the idea of having a different set of settings for development vs. test vs. production. Real apps have this too, but often the framework around them doesn't accommodate it and you end up having to swap configuration files in and out to achieve the same effect (see human error above).
Good practices. Several things I've mentioned above embrace and encourage good programming practices (MVC, standardized project layout, etc.) but Rails is often explicit in encouraging them and not just implicit. For evidence of that you need look no further than its built in support for test driven development.
I blogged in detail about why I love Rails three years ago, but for me for number one cool feature is that it makes developing web applications easy and fun.
To name a few items:
Large developer community (not saying that python doesn't)
Convention over configuration rocks
Can be used with JRuby/Warbler to make rails run on Java Application servers. Very important when trying to drag Enterprise into the 21st century (Django can be used with Jython to work with application servers, but is less mature).
MVC framework helps keep your application structured.
Scaffolding and generators to get your project moving.
Rails doesn't try to be the only way to do web applications, that's not the intent. It fulfills a specific set of needs.
This isn't a comparison against Python - it's a general list of things I like.
I write a lot less code than I would in Java
... And the code I do right is very readable and maintainable
I very rarely need to think where some code lives or how to handle a common task - it just has its place (e.g. migrations are built in)
You don't end up using lot of different technologies on one project (Java, EJB, Hibernate, JSP, SQL DDL, Ant, XML, taglibs)
Interpreted rather than compiled saves you lots of development time
One of the main reasons for me is that it puts fun back into web programming.
Suddenly things become simple and within reach. you don't need months of code crunching and
don't need tons of code written. you can do some pretty amazing things with just a few lines.
And it feels good :)
Honestly, I like the design of Django more then rails, but I like ruby more then python. Its a personal thing, because I know plenty of people who feel the opposite way, but I find ruby to be one of the most elegant languages I have ever used.
My main motivation for using Rails is ruby. I touched a lot of languages before I found ruby and I never felt I was any good in any of them. When I met ruby everything just made sense. It's a beautiful language; Easy to learn but hard to master.
I use rails because it suits my needs as a webdeveloper and is very feature rich.

Resources