How I can add undo functionality with SubSonic?
You're not going to get many answers with this. Undo functionality is very costly and complex to implement. I think Rob toyed around with adding automatic undo functionality in (based on parallel tables with names set by convention), but I don't think that went anywhere. He's been spending his time on bringing SubSonic into linq-land and T4-ville.
If you're looking for an ORM/data object framework that has undo baked in, you'll probably want to check out CSLA.NET. It is, no surprise, a heavy duty framework which will probably require some heavy lifting to get it into your application. You'll have to do some of the database work SubSonic does for you, no matter what.
Related
I'm real interested in using SubSonic, I've downloaded it and I'm enjoying it so far, but looking at the activity on github and googlegroups it doesn't seem to be very active and looks a lot like a project that's dying. There's no videos about it on tekpub and Rob seems to be using nHibernate for all his projects these days. I don't want to focus on learning SubSonic and integrating it into my projects if it's not going to live much longer.
So my question is what's happening with subsonic development, is there a new release imminent is there lots going on behind the scenes or is it as inactive as it seems?
I get this question, it seems, if I don't pop a release every 2 months or so. I will admit I'm behind on getting 3.0.0.4 out the door - but there's some patched code that people are sending in without tests and I will not accept that - I'd rather take my time and make sure we don't push bugs (which I apparently did with 3.0.0.3).
Anyway - it's a valid question and no, SubSonic isn't "dying". The best place to see the activity is on the Github site itself:
http://github.com/subsonic/
This is one of the main reasons I chose Github, so people can see the activity. I just pulled in a number of changes and am waiting on a last one to get tweaked (there were merge conflicts).
RE your other points:
No, I'm not using NHibernate for my work. I'm using it for Kona and a screencast. I answer just about all the email I get from out group but yes, GoogleGroups is a sad thing when it comes to pruning the spam. Your best bet is to just email the group list for a question - it will get answered pretty quickly.
In terms of "death" - I need to talk about that a bit. Open Source projects are incapable of dying if they were born in a fit of inspiration and people find it useful. Both are true of SubSonic. Even if I gave up and told everyone to f-off, someone would pick it up and run with it. I do have to work, like most people, and I have to fit SubSonic into the little amounts of freetime I have between work and family. But there's no way I'd let this die - it means far too much to me.
Either way - I'm sure I'll be back here again in 6 months, answering this question again :).
I suspect since its that time of year people are on holiday/vacation so support here is reduced. I have just started using it and havent had responses to some questions and the last release was in July, so am hoping support continues.
I must state that although there isn't a new release every 2 months as Rob stated that you may get that feeling sometimes. Although there is still action on the google group and github. If anything before christmas there were more fresh faces starting to make contributions than before (even simple ones like doco) this shows me that there may be more interest than ever, its just that people are getting on with it.
My work uses Subsonic (both 2.2 and 3.0.0.3) in most projects where we have control over it. We have around 28 .net devs and they all love it (we don't get caught up in what it can't do as its not an ORM/data access say per se.
As we only use Subsonic for low level query tool and not as a data access layer i spose we're not too closely connected to it if we need to bail on it, but we are yet to have a reason too.
My point is this: Its a really really easy to use, easy to pick up, easy to modify, light weight querytool/ORM(to a lesser extent). There are few tools out there that have all these properties and yet don't lock you into a million schools of thought on things. Because of this i don't see it dieing any time soon - its too addictive a tool to have on your bat belt.
I'm an active record fan buoy and SubSonic Rocksorz My Sockorz!
Because of this i recommend SubSonic to a lot of people and will continue to. While we don't use it on extremely large projects (more for project continuity reasons like you mentioned than because it can't do the job)
Well.
I don't know how subsonic is progressing. I started use subsonic from 2007, before upgrade to subsonic3, I was pretty convenient with subnoic2. it is stable and predictable. But with subsonic3, even 3.0.0.3. It is somewhat disappointed for me. I don't want to mention the features that works. Thanks. Subsonic map table correctly. The thing I want to talk is about "Update". I tried with the code but it gave exception. After dig into the code, it is signing...
Look at my code:
FarmDB db = new FarmDB();
db.Update<UserAdornment>().Set(o => o.is_working == false)
.Where(o => o.user_name == HttpContext.Current.User.Identity.Name && o.type == userAdornment.type && o.id != userAdornment.id).Execute();
Is this correct?
After fixed the NullReferenceException some one asked which I suffered too. Each time I run this query, all my rows with user_name=currentname is set is_working to false. After checked code:
In update.cs
public Update<T> Where(Expression<Func<T, bool>> column)
{
LambdaExpression lamda = column;
Constraint c = lamda.ParseConstraint();
And check lamda.ParseConstraint();
I see, whatever how many 'where" I want to search, it only return the first one, the worse thing is after it,
//IColumn col = tbl.GetColumnByPropertyName(c.ColumnName);
//Constraint con = new Constraint(c.Condition, col.Name, col.QualifiedName, col.Name);
//con.ParameterName = col.PropertyName;
//con.ParameterValue = c.ParameterValue;
It built another constraint from previous one, but drop all the "condition" in last one.
How can it be right?
I don't look into subsonic's sourcecode too much and don't understand it how it is implemented well. But I am using subsonic3 in my project and highly depend on it to work correctly. Really hope every bug can be tested and fixed in time.
Is there a workaround for implementing cross cutting concerns without going into aspects and point cuts et al.?
We're in Spring MVC, and working on a business app where it's not feasible to go into AspectJ or Spring's aspect handling due to various reasons.
And some of our controllers have become heavily bloated (too heavily), with tons of out-of-focus code creeping in everywhere.
Everytime I sit down to refactor, I see the same things being done over and over again. Allow me to explain:
Everytime I have to prepare a view, I add a list of countries to it for the UI. (Object added to the ModelAndView). That list is pulled out of a DB into ehCache.
Now, initially it was terrible when I was trying to add the lists INLINE to the mav's everywhere. Instead, I prepared a function which would process every ModelAndView. How? well, with more garbage calls to the function!
And I bought out one trouble for another.
What's a design pattern/trick which can help me out a bit? I'm sick of calling functions to add things to my ModelAndView, and with over 3500 lines of only controller code, I'm going mad finding all the glue points where things have gone missing!
Suggestion are welcome. Cross cutting concerns flavor without AspectJ or Spring native.
Since you are using Java, you may consider moving your code to Scala, since it interacts well with Java, then you can use traits to get the functionality you want.
Unfortunately cross-cutting is a problem with OOP, so changing to functional programming may be a solution, but, I expect that in actuality they are using AOP to implement these mixins, so it would still be AOP, just abstracted out.
The other option is to look at redesigning your application, and make certain that you don't have duplicate code, but a major refactoring is very difficult and fraught with risk.
But, for example, you may end up with your ModelAndView calling several static utility classes to get the data it needs, or do ensure that the user has the correct role, for example.
You may want to look at a book, Refactoring to Patterns (http://www.industriallogic.com/xp/refactoring/) for some ideas.
I know this question seems subjective but it's really pretty simple. As a long term user, and part time contributor to SubSonic I'm interested in what the community thinks would be the single best way to improve it.
So what's your opinion, how would you make SubSonic even better? What one thing would make you more likely to use/recommend/evangelise/stop complaining about it?
As I said I know this is a bit subjective and may get closed but as SO is the main support forum for SubSonic I think this could be a useful way to solicit opinion and/or contributions.
To keep this from turning into a general discussion here's the rules:
No omnibus wishes
No duplicate wishes
Up-vote those you agree with rather than re-posting them
Ability to run in MediumTrust out of the box
In all honesty the biggest thing thats lacking is solid documentation and HowTo's
Its got better but I think it needs a lot more.
Ability to automatically map collections of other objects, like Fluent NHibernate does.
When SubSonic throws an exception that isn't clear, I'd like to be able to use Google or some other mechanism to discover more information about how to keep my development effort moving forward. Right now it's too easy to get into a situation where you have to go spelunking into the SubSonic source code since SubSonic doesn't seem to be very proactive when the user goes off the "happy path".
This critique is hardly specific to SubSonic. Many (most?) software products suffer from this same problem. I have not really had this problem with NHibernate though, which is SubSonic's most clear competitor.
Faster and higher quality releases
Binary types for SimpleRepository (Images)
Left Outer Joins
Support more database-independent code generation...
What I mean by this is that it is truly a real pain if your application wants to talk to different databases (e.g. SQL Server and Oracle) and you want to only have one set of generated DAL objects. I would love it if you had the option of specifying that any SQL code that gets sent to the DB would be as compatible with most engines as possible, since right now if you generated your objects targeting SQL Server then all queries will be of the form:
SELECT [schema].[table_name] FROM ....
Sadly, this does not work in Oracle, so basically you're out of luck there.
Perhaps this isn't a huge concern for most of you, but I'm currently writing a commercial app that touts one of its main features as being able to run on various database engines just by changing its configuration and I chose SubSonic because I thought it could handle the job pretty easily, but I'm honestly having second thoughts now because of all the hoops I may have to jump through just to get this to work correctly under different environments.
Support MS Access ,Postgres and FireBird database :)....
I am looking for a good way to keep a design document up to date with the latest decisions.
We are a small team (two developers, game designer, graphic designer, project manager, sales guy). Most of our projects last a couple of months. At the start of the project a design is made but we generally find ourselves making changes or new decisions throughout the project. Most of these changes are improvements, so we want to keep our process like that. (If the changed design results in more time needed this is generally taken care of, so that part is OK)
However, at the moment we have no nice way of capturing the changes to the initial design document and this results in the initial design quickly being abandoned as a source while coding. This is of course a waste of effort.
Currently our documents are OpenOffice/Word, and the best way to track changes in those documents will probably be adding a changelist to the top of the document and making the changes in the text in parallel — not really an option I'd think as ideal.
I've looked at requirements management software, but that looks way to specialized. The documents could be stored in subversion but I think that is a bit too low level to give insight in the changes.
Does anyone know a good way to track changes like these and keep the design document a valuable resource throughout the project?
EDIT: At the moment we mostly rely on changes to the original design being put in the bugtracker, that way they are at least somewhere.
EDIT: Related question
Is version control (ie. Subversion) applicable in document tracking?
I've found a wiki with revision logging works well as a step-up from Word documents, provided the number of users is relatively small. Finding one that makes it easy to make quick edits is helpful in ensuring it's kept up to date.
Both openoffice and word include capaiblities for showing/hiding edits to your document. Assuming there's resistance to changing, then that's your best option - either that or export to text and put it into any source control software.\
Alternatively, maintain a separate (diffable using the appropriate tool) document for change-description text, and save archive versions at appropriate points in time.
This problem has been a long standing issue in our programming shop too. The funny thing is that programmers tend to look at this from the wrong optimization angle: "keep everything in one place". In my opinion, you have two main issues:
The changes' descriptions must be easy to read ("So what's new?")
The process should be optimized for writing of the specification to agree upon, and then get to work already!
Imagine how this problem is solved in another environment: government law making. The lawbook is not rewritten with "track changes" turned on every time the government adds another law, or changes one...
The best way is to never touch a released document. Don't stuff everything into the same file, you'll get the:
dreaded version history table
eternal status "draft",
scattered inconsistencies,
horribly rushed sentences, and
foul smelling blend of authors' styles
Instead, release an addendum, describing only the changes in detail, and possibly replacing full paragraphs/pages of the original.
With the size of our project, this can never work, can it?
In my biggest project so far, I released one base spec, and 5 consecutive addenda. Each of around 5 pages. Worked like a charm!
I don't know any good, free configuration management tools, but why not place your design under source control? Just add it to SVN, CVS, or whatever you are using. This is good because:
1) It is always up to date (if you check it in, of course)
2) It is centralized
3) You can keep track of changes by using the built-in compare feature, available in almost any source control system
It may not be the 'enterprisish' solution you'd want, but you are a small team of developers anyway, so for that situation, it is more than perfect.
EDIT: I see now that you already mentioned a source control system, my mistake. Still, I think it should work well.
Use Google Docs. Its free, web based, muti-user in real time, you can choose who has access to your documents, and keeps versioning. You can also upload all your word documents and it will transform them for you.
For more information: http://www.google.com/google-d-s/intl/en/tour2.html
I work on an application that has a both a GUI (graphical) and API (scripting) interface. Our product has a very large installed base. Many customers have invested a lot of time and effort into writing scripts that use our product.
In all of our designs and implementation, we (understandably) have a very strict requirement to maintain 100% backwards compatibility. A script which ran before must continue to run in exactly the same way, without any modification, when we introduce a new software version.
Unfortunately, this requirement sometimes ties our hands behind our back, as it really restricts our ability to innovate and come up with new and better ways of doing things.
For example, we might come up with a better (and more usable) way of achieving a task which is already possible. It would be desirable to make this better way the default way, but we can't do this as it may have backwards compatibility implications. So we are stuck with leaving the new (better) way as a mode, that the user must "turn on" before it becomes available to them. Unless they read the documentation or online help (which many customers don't do), this new functionality will remain hidden forever.
I know that Windows Vista annoyed a lot of people when it first came out, because of all the software and peripherals which didn't work on it, even when they worked on XP. It received a pretty bad reception because of this. But you can see that Microsoft have also succeeded in making some great innovations in Vista, at the expense of backwards compatibility for a lot of users. They took a risk. Did it pay off? Did they make the right decision? I guess only time will tell.
Do you find yourself balancing the conflicting needs of innovation and backwards compatibility? How do you handle the juggling act?
As far is my programming experience is concerned, if I'm going to fundamentally change something that will prevent past incoming data to be used correctly, I need to create an abstraction layer for the old data where it can be converted for use in the new format.
Basically I set the "improved" way as default and make sure through a converter it can read data of the old format, but save or store data as the new format.
I think the big thing here is test, test, test. Backwards compatibility shouldn't hinder forward progress.
Split development into two branches, one that maintains backwards compatibility and one for a new major release, where you make it clear that backwards compatibility is being broken.
The critical question that you need to ask is wether the customers want/need this "improvement" even if you perceive it as one your customers might not. Once a certain way of doing things has been established changing the workflow is a very "expensive" operation. Depending on the computer savyness of your users it might take some a long time to adjust to the change in the UI.
If you are dealing with clients innovation for innovation's sake is not always a good thing as fun as it might be for you to develop these improvements.
You could alawys look for innovative ways to maintain backwards compatibilty.