How the connection is managed by data access application block in Enterprise library? - enterprise-library

I am new to entlib. I want to know how the connection state is managed by entlib, if I want to create a project which can be accessed by thousands of users is entlib data access application block better to use? Does it manage opening of closing of connections by itself?
Please explain me in detail...

I'm afraid this is not really the place for detail, however there is a free ebook called "Developer's guide to Microsoft Enterprise Library 5" which has plenty of detail. If you need more you can also download and examine the code for the whole library.
The main advantage of enterprise library is that it's easy to use, and does a lot of things you would otherwise have to re-implement in your code. Enterprise Library is part of Patterns and practices section in MSDN and implements well thought out and reviewed methods of carrying out common tasks.
Enterprise library helps to resolve ADO.NET issues, such as deciding how your code should call the close method, by automatically managing connections as far as reasonably possible.

Related

REST API using Civetweb and Lua

So, my task is to develop web application using the following technologies:
Angular on front end,
On back end, I will use civetweb as stand-alone web server (https://github.com/civetweb/civetweb) and Lua (or C if Lua doesn't fit well),
Sqlite3 (http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki)
After a certain amount of time spend on the research about this topic (back end side), I am not sure what are the best practices for this, due to the fact that I couldn't find useful examples, except for the official documentation on civetweb github repository.
Specifically, I am not sure what is the best way: to handle requests/responses, structure the code (the main server logic, the part of the system which is in the charge of working with database, etc.)
I would appreciate any suggestions, links to examples or useful documentation, etc.
P.S. I am used to object-oriented world, and that is the main cause of my problems.

Advices on server implementation for server/client structure iOS App development?

There are must be a lot of apps that are designed to communicate with server. My question is only about App installed on iOS device + Server side service interaction. Web app is not what I am talking about, and there should be no webpage involved in this discussion at all. Typical examples are Apps like Instagram and Twitter, in which most of the information exchanged between the App and the server is just data like String, Image and Integers(wrapped in JSON or XML), no webpage presentation needed.
My question will be: if you are an independent app developer, and you are designing such an app from scratch without any existing website API, database structure or application(so you are not limited by any existing API or database structure or application protocol), What will be the most efficient approach?
What the sever side need to do are:
receive data send by the App;
process the data with designed logic;
interact with database(like MySQL);
do necessary data mining and analysis---this could be a constantly running service or one time task requested by the App client;
send the data back to the App upon request or spontaneously;
exchange or broadcast the data between/among different App clients (i.e.: group chatroom and peer to peer message);
As far I as know there are 3 obvious options to implement the server side:
PHP
Python
Ruby on Rails
(please feel free to add more options)
My questions are:
which one is the most appropriate choice to implement the server side?
If the App is focusing intensively on natural human language/text searching, analyzing and data mining, which one is the best choice? I heard Python is doing pretty good in this area.
Any advice on the database choices? I am using MySQL for now, and I found it's quite powerful for my purposes, I heard Twitter is switching to Cassandra. Will that be too difficult to start with?
For the server end, if you need to build a Server management interface, for you as an admin to manage and monitor the community, membership, data and such, is there any existing solution, or framework or tool for that? what will be the most efficient approach?
If a new programmer has no experience in non of them, which one you suggest he/she to start with?
Is there any good reference material or sample code on the server side in such context we can learn from?
I know there are a lot of very experienced experts on these areas on Stackoverflow, but I saw more newbies who just entered the iOS developing area without much knowledge in server/database programming experience. And I hope this thread can help these who are thinking to design an App with server/client structure but have no idea where to start with.
ps: I will keep updating this question thread and adding my findings on this topic, to help all other users at stackoverflow. :-) Please try to make your answer informative, easy to understand, and constructive. I guess most of readers for this thread will be new members of this great community.
Are you sure you want to spend time & money to develop your own Server & develop your own API?
There are lots of mBaaS (mobile Backend as a Service) providers today such QuickBlox, Parse,StackMob, which are ready to use and they have great Custom Objects API and some of predefined modules. They have great free plans with big quota. Some of them such QuickBlox has Enterprise plan - so you can buy license and they server team update server for you purpose.
So, i recommend not develop your server and think about mBaaS market.
Just about your issue - I can recommend look at QuickBlox Custom Objects code sample and also Custom Objects API. Custom Objects module provides flexibility to define any data structure(schema) you need. Schema is defined in Administration Panel. The schema is called Class and contains field names and their type. I think it's what you need.
which one is the most appropriate choice to implement the server
side?
Well that depends on what you know, there is reason to choice one of the other
If the App is focusing intensively on natural human language/text
searching, analyzing and data mining, which one is the best choice? I
heard Python is doing pretty good in this area.
This would reflect on your first question, you pick the language on you needs. Thus if python makes it easier then pick that one.
Any advice on the database choices? I am using MySQL for now, and I
found it's quite powerful for my purposes, I heard Twitter is
switching to Cassandra. Will that be too difficult to start with?
Again not one that is easy to answer, since it all has to do with requirements. But any SQL server will do. Cassandra is meant for "scalability and high availability without compromising performance" accourding to there website. Do you think you webservice will get many request then it might be a choice to consider.
For the server end, if you need to build a Server management
interface, for you as an admin to manage and monitor the community,
membership, data and such, is there any existing solution, or
framework or tool for that? what will be the most efficient approach?
This again is only going to be answered when you pick the a SQL server and server language.
If a new programmer has no experience in non of them, which one you
suggest he/she to start with?
Start with something simpler, you are really going out on a limb here.
Is there any good reference material or sample code on the server
side in such context we can learn from?
Propably there is some, but you should really start small and work from there.
Twitter started out as a Rub on Rails app and is working on scalability and availability which ruby is not really good ar (that is my person opinion). or Look at facebook they have written a php to c compiler to make php run faster.
The only thing I can say to start code, when you app does take off then tackle the some of the performance issues.
And since you state that you are new to programming do not bite of more then you can chew.
This is a huge question and I don't think there is a best answer. It most depends on what you care about, such as how quickly the development process, how easily the implementation, etc.
And which one is popular, which one is cool, I don't think it make really sense.
In my personal opinion, I'm good at ASP.NET and I can get Windows server easily, so I'll start with an ASP.NET service to provides data.
And, to be continued.

Cafeteria Management System as a project. What should I use?

This is a part of my course project.
Basically, there are vendors which provide food and at peak hours the queue gets so large that people have to wait long for their order.
Our project is like an online site which will enable users to order food. After ordering the food, the user will get an info as to where does he lie in the queue. This way students can order from their hostel rooms without actually going to the vendor and getting their time wasted by waiting in the line. As soon as the user orders the food, vendor gets notified of the project so that he can start preparing the food.
I am completely new to web development so I am not sure what to use. This project will also work as an exercise to learn about web development.
I have heard about Drupal & Joomla CMS. Also, Django framework is also there and I am actually confused as to what technology to use.
I am also confused as to what is the difference between a framework and a CMS? How do they differ and which one will suit me.
So, how do I go about developing the
application?
A framework is a basic application without any concrete business logic. It contains basic structure and sometimes basic features (like database connectivity and other standard libraries). You have to write your code yourself.
A CMS is a content management system. It is essentially a complete website but without the content. it provides tools to write content (web pages). The most popular ones (like Joomla) come with a bunch of templates too that you can download to give your site any look you want.
A CMS probably doesn't have enough features to provide you with this logic. You will probably need to do some programming to get this done. It may still be useful to use a CMS, though. Lots of them support various plugins that allow you to add these kind of features and still allow you to easily edit regular pages.
Frameworks are libraries turned on their heads. You plug a library into your code; a framework turns this around by abstracting a particular problem in such a way that you plug your code into it to solve a problem. It's the Hollywood principle: "Don't call us; we'll call you."
People who write frameworks have deep knowledge of a particular problem domain. They usually represent the distillation of several attempts to solve a problem, with best practices, clear abstractions, and good plug-in points made clear from long experience.
Django is a Python framework for web applications that have a browser front end and relational databases for persistence.
That's one example of a framework.
A CMS (Content Management System) allows users to dynamically add and manage content in a web application. I think they solve slightly different problems from Django, because it is specialized to the problem of content management.
I'd recommend starting your queuing problem without a front end at all - just text. Concentrate on the subtleties of queuing. Get that right with your object model and then expose a user interface to display it to users.
CMS is a 'content management system'. If provides modules that you can plug in. The end effect is it sets up a website for you, and you have admin pages where you can enter content. For special stuff, you use plugins. If you have to, you can write your own plugins.
A development framework is just a stack of technologies you can use to develop an application. So for example, the Grails framework uses Hibernate(persistence) and Spring(dependency injection and other stuff) under the covers -- it is providing and using existing tools (which are themselves frameworks) which you will in turn use to build the application.
With a framework, you basically start with a bunch of tools in your toolbox, but little or no parts of a running web app out of the box. You have to develop the functionality with the tools. With a CMS system, it's like they have implemented something for you, but it is really generic and you will have to tailor it to your needs.

Any good client-server data sync frameworks available for iPhone?

I'm just getting into the client-server data sync stage of my iPhone app project, and have managed to get my CoreData data model loading on both the iPhone client and my TurboGears server (which is good). I'm now beginning to tackle the problem of sync'ing data between the server and multiple clients, and while I could roll my own, this seems like one of those problems that is quite general and therefore there should be frameworks or libraries out there that provide a good deal of the functionality.
Does anyone know of one that might be applicable to this environment (e.g. Objective-C on iPhone, pyobjc / Python on the server)? If not, does anyone know of a design pattern or generally-agreed upon approach for this stuff that would be a good road to take for a self-implementation? I couldn't find a generally accepted term for this problem beyond "data synchronization" or "remote object persistence", neither of which hit much useful on Google.
I did come across the Funambol framework which looks like it provides this exact type of functionality, however, it is C++ / Java based and therefore seems like it might not be a good fit for the specific languages in my project.
Any help much appreciated.
Since you are using TurboGears already, take a look at the RestController documentation. Using RESTful services has become a widely adopted architecture with many implementations for both clients and servers. Matt Gemmell's MGTwitterEngine is a good example of the client implementation of a specific API, Twitter.

productivity superstar frameworks/tools for side gigs

If you were going to start building web sites as a consulting business on the side -- keeping your day job -- and you also had a toddler and a wife, what frameworks/tools would you pick to save you typing?
Any language.
I'm looking for a productivity superstar stack that won't tie my hands too much when I have to update the site 6 months later, or "evolve" the data model once in production.
It needs to allow me to say "yes" to the client: community features, CMS, security, moderation, AJAX, ...
I would suggest Django. Super simple to get something up and running really quick. You are using Python which has a large library to go with it. For me Ruby on Rails would be a close second.
I'd probably look at DotNetNuke. Its easy to set up (a lot of hosts will do it for you) and easy to use and put together a custom site that business's will be able to maintain in the future.
Its fairly easy to create custom modules that are specific to a business and hundreds of modules for sale (or free) that can be integrated into DNN for special uses.
Take a look at Microsoft's Sharepoint server if you'd like a pre-made framework with many options for plugging in your own code. Sharepoint is kind of a world unto itself but it is a very powerful environment.
Update: I'm surprised to have been voted down on this one. Keep in mind that the questioner specifically requested frameworks that included a CMS. Sharepoint meets this criteria - unlike straight .NET or other web development frameworks.
If you are going to vote the entry down, I think you owe it to the person who asked the question to explain why you don't think he should not even explore it as an option. You could be right - collective wisdom is what voting on SO is all about. But without an explanation, we don't know why you think you are right.
My answers are going to revolve around the .NET stack.
Use Master pages and CSS templates. This makes it so much easier to pop in a new look and feel for your customer.
For sure I'd include the Dynamic Data framework in the .NET world.
Hosting might become an issue for your customer. Questions around managing email addresses, procedures on how to quickly update the website to include the new contact phone number (different for each customer, I'd assume) Consider getting a reseller account on your favorite webhost, and dole out webhosting accounts as appropriate. There are lots of issues around this point. It may turn out to be a nice source of recurring revenue.
Build yourself a few patterns including a database wrapper which would handle all your data calls (i.e. a dll which wraps all your data calls, sets up your ADO.NET objects, runs your sproc calls, and picks up the connstring from app.config or something similar.)
This goes a long way to maintainability as well.
I would recomend going with anything MVC in a language you can undertand! Theres a couple of CMS's in python, php and ruby using that design and well... that allows you to be ready for combat for Ajax and expanding anything very fast.
This is definitely not a question that can be answered.
I prefer asp.net webforms because I think it allows for extremely rapid web app development, but I am sure you will receive recommendations for:
asp.net mvc
Ruby on Rails
PHP and some framework
Python and some framework such as Django
I believe PHP has the most pre-built apps that you can use, though asp.net also has the things you are looking for.
All of these platforms and frameworks can do what you want.
Choose between Rails and Django. They both have different strengths. I like Rails better in general, but Django's admin interface can save you a lot of time when you need it.
There's another factor to take into consideration here: what are you the most familiar with? I believe that some studies have found upwards of a 30% loss of productivity when trying to learn a new language/framework.
Sometimes, there's nothing wrong with just sticking to what you know. But if you're interested in what languages/frameworks to learn, I'll refer you to the other posts because the above was the only thing I really have to add.
I recommend looking into Grails. It uses Groovy which is similiar to Java (so if you know this already you're good to go). Groovy runs on the JVM so you can still use all the great libraries already available for Java. Yet, since it's a dynamic language with a lot of the similar bells and whistles like Ruby you can use closures and that kind of neat stuff when you need/want to. And you're not slowed down by Java's traditonal slow compile-deploy-test development cycle.
Grails is already setup with Hibernate and Spring. You can create CRUD application in practically no-time (pretty much like Rails applications), and at the same time drill down and be able to control every little details since it's built on such proven and well-supported technologies. In addition there's literally hundreds of plugins available that helps you easily set up things like mailing lists, security, AJAX components and so on.
Otherwise, if you want to set up a community site and don't want to code a single line you could always check out ning.com.