Post #193,080
2/4/05 4:55:37 PM
|
The joys of .Net
So my company decided to rewrite in .Net instead of Java since PowerBuilder is commiting to becoming a .Net tool and has also released DataWindow.Net. I'm starting to port my Java domain object framework to C#. Here's some of the fun I've run into so far: 1) The collections framework is even worse in .Net than in Java. Not only are many of the collections not available, but they also did not implement the ToString or Equals method. 2) Serializable is no longer an interface, it's now a attribute. This means I can no longer enforce that certain methods return a serializable object. 3) You cannot have different access modifiers for properties. I had a number of objects with public getters and protected setters. No more. 4) Library source is not easily available (you have to go look it up in the rotor sources). 5) Visual Studio.Net is crap compared to Eclipse. While you can build GUIs easily, everything else is so much harder. ReSharper helps some 6) Inner classes don't have access to their outer classes and there are no anonymous inner classes. I'll leave you with the conversion of a method from Java to C# (illustrates #6). Thanks for letting me vent... Java: \nprivate void insert(final AbstractDomainObject obj, SQLDatabase database) throws Exception {\n Collection parms = new ArrayList();\n Bean bean = Bean.createBean(obj);\n final Serializable originalId = obj.getId();\n \n String sql = "insert into \\"" + tableName + "\\"" + \n " (" + buildInsertColumnString(bean, originalId) + ") " +\n \t "values (" + buildInsertValuesString(bean, originalId, parms) + ")";\n \t \n if (database.executeUpdate(sql, parms) == 0) {\n throw new NoRowsUpdatedException();\n }\n\t\t\n if (autoincrement && originalId == null) {\n Serializable value = getLastAutoIncrement(database); \n Serializable newId = (Serializable) convertColumn("id", value); \n obj.setId(newId);\n }\n\n database.addDatabaseEventListener(new DatabaseEventAdapter() {\n public void afterCommit(DatabaseEvent event) {\n obj.onInsertCommitted();\n\tevent.getDatabase().removeDatabaseEventListener(this);\n }\n public void onRollback(DatabaseEvent event) {\n\tobj.setId(originalId);\n\tevent.getDatabase().removeDatabaseEventListener(this);\n }\n });\t\n}\n The C# conversion: \nprivate void Insert(AbstractDomainObject obj, ISQLDatabase database) \n{\n ICollection parms = new ArrayList();\n Bean bean = Bean.CreateBean(obj);\n object originalId = obj.Id;\n\t \n String sql = "insert into \\"" + tableName + "\\"" + \n\t\t" (" + BuildInsertColumnString(bean, originalId) + ") " +\n \t"values (" + BuildInsertValuesString(bean, originalId, parms) + ")";\n\t \t \n if (database.ExecuteUpdate(sql, parms) == 0) \n {\n throw new NoRowsUpdatedException();\n }\n\t\t\t\n if (autoincrement && originalId == null) \n {\n object value = GetLastAutoIncrement(database); \n object newId = ConvertColumn("id", value); \n obj.Id = newId;\n }\n\n new InsertListener(obj, originalId, database);\n}\n\nprivate class InsertListener\n{\n private AbstractDomainObject obj;\n\n private object originalId;\n\n public InsertListener(AbstractDomainObject obj, object originalId, IDatabase db)\n {\n this.obj = obj;\n this.originalId = originalId;\n db.AfterCommit += new DatabaseEvent(this.AfterCommit);\n db.OnRollback += new DatabaseEvent(this.OnRollback);\n }\n\n public void AfterCommit(IDatabase db)\n {\n obj.OnInsertCommitted();\n RemoveListeners(db);\n }\n\n public void OnRollback(IDatabase db)\n {\n obj.Id = originalId;\n RemoveListeners(db);\n }\n\n private void RemoveListeners(IDatabase db)\n {\n db.AfterCommit -= new DatabaseEvent(this.AfterCommit);\n db.OnRollback -= new DatabaseEvent(this.OnRollback);\n }\n}\n
|
Post #193,082
2/4/05 5:25:35 PM
|
Ick.
I've heard similar comments about the MS IDEs vs. various Java IDEs, though. There's a big C++ programmer here who loved Visual Studio 6 until he started using JDeveloper (which isn't even a particularly good Java IDE).
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #196,073
2/23/05 10:44:33 AM
2/23/05 10:45:57 AM
|
It warn't me
Visual Studio blows the proverbial equine quadriped. Always liked ... well ...just about anybody else's development environment vs. VisStudio. Including Eclipse. But very partial to the Builder/Delphi series
(And some of the Java development IDEs are also very cool.)
[Edit: what would be a jb4 post without the ObTypo?]
jb4 shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
Edited by jb4
Feb. 23, 2005, 10:45:57 AM EST
|
Post #196,079
2/23/05 11:35:24 AM
|
Here != IWETHEY in this case.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #196,089
2/23/05 11:59:55 AM
|
So what's a good java IDE to use?
Been learning java/spring. Typing getters and setters is really tedious. I'm assuming an IDE will help with that? So which one should I get that won't do so much of it for me that I won't learn anything?
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #196,094
2/23/05 12:21:31 PM
|
Intellij IDEA
But then again, Emacs will do the getters and setters for you as well.
The question you have to answer is, "how much is too much?"
Eclipse is a free IDE that a lot of people like. IDEA is better, IMO, but it also costs money.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #196,095
2/23/05 12:26:47 PM
|
While learning, free is good
Once I'm paid for it, someone else can pay for it.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #196,096
2/23/05 12:45:16 PM
|
Checkout Eclipse
It's made me miserable in VS.Net because I miss all the Eclipse features I've come to know and love. Plus you can't beat the price.
It can be a bit overwhelming to beginners. One developer here who used Visual J++ in the past said it took him a few months of using it before he figured it out.
If you're the kind of person who likes to check out menus and pop ups and try stuff out, you'll be fine.
|
Post #196,137
2/23/05 5:18:38 PM
|
I despise that program
and don't think anything that "takes a few months to figure out" can be considered useful.
Eclipse is an "enabler" for Java development in the same way that AA talks about enablers to alcoholics. Probably better if you just let them hit bottom and regain their senses.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #196,138
2/23/05 5:23:00 PM
|
I'm no psychic...
...but I'm getting a definite sense, a clear feeling that you don't like Java.
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #196,147
2/23/05 7:22:18 PM
|
You ought to work in the circus
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #196,168
2/24/05 1:35:41 AM
|
I come here. Next best thing.
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|
Post #196,148
2/23/05 7:24:52 PM
|
I think IDEA is good - I use it when I do Java
but I often feel like its an elaborate crutch that I ought not to need.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #196,140
2/23/05 5:28:09 PM
|
ICLRPD (new thread)
Created as new thread #196139 titled [link|/forums/render/content/show?contentid=196139|ICLRPD]
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #196,220
2/24/05 1:04:26 PM
|
It's all relative
I originally started out in VisualAge for Java -- I was very disappointed in Eclipse when it was introduced as the replacement for VAJ. But I also spend a lot of time in both VisualStudio.NET and the PowerBuilder IDE and Eclipse is an amazing tool compared to those.
|
Post #196,221
2/24/05 1:07:28 PM
|
I am such a lUser
Installed it last night. My first impression was, "Gosh, that's pretty." When I say "first impression" I mean literally first impression: I was looking at the splash as it launched.
I'm not supposed to be swayed by splash screens. I turn them off. I know they have nothing to do with the product. But gosh, it's pretty.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
|
Post #196,343
2/25/05 2:40:53 PM
|
Look at the pretty COLORS!
jb4 shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
|
Post #196,136
2/23/05 5:09:23 PM
|
Concur
(Couldn't remember its name...) Used it in a training class where we had to use Java. Actually liked it a lot.
jb4 shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
|
Post #196,141
2/23/05 5:31:00 PM
|
As a rabid, frothing Emacs user
IDEA has come to closest to converting me away, at least for Java development.
Regards,
-scott anderson
"Welcome to Rivendell, Mr. Anderson..."
|
Post #196,175
2/24/05 5:28:41 AM
|
Another vote for Intellij
It is head and shoulders above any other Java IDE
|
Post #193,090
2/4/05 7:36:48 PM
|
Listeners
I thought C# could pass functions references, much like Delphi, meaning there's much less need for inner classes.
Matthew Greet
But we must kill them. We must incinerate them. Pig after pig, cow after cow, village after village, army after army. And they call me an assassin. What do you call it when the assassins accuse the assassin? They lie. They lie and we must be merciful to those who lie. - Colonol Kurtz, Apocalypse Now.
|
Post #193,102
2/4/05 11:08:19 PM
|
Re: Listeners
I thought C# could pass functions references, much like Delphi, meaning there's much less need for inner classes.
It can. And, being the good .Net programmer that I am, I used events on my Database interface. Problem is, each object needs to respond to events from the database, but I don't want any database code in my domain objects. An anonymous inner class was perfect, but I can't do that in .Net, so I had to create a seperate class.
|
Post #193,110
2/5/05 12:00:27 AM
|
Crap and Double Crap
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #193,136
2/5/05 10:12:02 AM
|
Interesting thing is...
My boss's boss is a former Smalltalk developer. He keeps asking me if there is a viable Smalltalk we could use. We need to be able to develop up to date Windows UIs that can be embedded in a PowerBuilder window and we can't have a license that requires us to pay a percent of our earnings (i.e. Cincom). I've found nothing.
Any ideas?
|
Post #193,140
2/5/05 10:31:49 AM
|
Umm... Squeak?
-- [link|mailto:greg@gregfolkert.net|greg], [link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey[link|http://it.slashdot.org/comments.pl?sid=134485&cid=11233230|"Microsoft Security" is an even better oxymoron than "Miltary Intelligence"] No matter how much Microsoft supporters whine about how Linux and other operating systems have just as many bugs as their operating systems do, the bottom line is that the serious, gut-wrenching problems happen on Windows, not on Linux, not on Mac OS. -- [link|http://www.eweek.com/article2/0,1759,1622086,00.asp|source]
|
Post #193,160
2/5/05 4:13:54 PM
|
Re: Umm... "up to date Windows UIs"
-- Chris Altmann
|
Post #193,189
2/6/05 12:02:26 AM
|
Looked at Dolphin?
What I know about Windows you could stick through the eye of a needle but I think that [link|http://www.object-arts.com/DolphinSmalltalk.htm|Dolphin] is aimed at Windows (uses native widget set).
There's also [link|http://www.objectconnect.com|Smalltalk MT]
You could check out IBM's[link|http://www-306.ibm.com/software/awdtools/smalltalk/|Visual Age Smalltalk].
Or, since MS claims you can host other languages on top of MSIL, there is [link|http://www.smallscript.com/|Smallscript/S#]. Its not a true smalltalk but it has some of the benefits.
[link|http://www.instantiations.com/sts/links.htm|http://www.instantia...com/sts/links.htm] is worth a look.
You can always approach Cincom if the license is a problem - they can be quite flexible these days (not like when PARCPlace had it).
The hosting in a PowerBuilder window bit - that's a bit weird though. I don't know if any of them can do that kind of integration.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #193,192
2/6/05 1:21:06 AM
|
Going farther afield
Look at Ruby. It shares some features of Smalltalk (notably its object model), can be used with up to date windows widgets, is open source, and if there isn't a way to plug into Powerbuilder, you might be able to add that.
There are major differences as well, but some of those may work to your benefit. For instance the syntax is more C-like, and it is file-based. Both of those make it easier for mainstream developers to come up to speed with it.
Cheers, Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
|
Post #193,657
2/8/05 1:28:51 PM
|
You lose a lot of power though
Avi talks about this on his blog this week.
[link|http://www.cincomsmalltalk.com/userblogs/avi/blogView?showComments=true&entry=3284695382|http://www.cincomsma...&entry=3284695382]
The Ruby distribution comes with a large amount of C code implementing the underlying language and library semantics: a parser, an interpreter, regular expressions, arrays, hash tables, a numeric tower, and so on. In some cases, like the parser, this code is kept hidden from the Ruby layer: there's no way with a stock Ruby interpreter to get at a Ruby parse tree from Ruby code. This makes certain tools much harder to write - the RDoc documentation generator, for example, has to include its own lexer because it can't access the one that comes with Ruby. It also makes the language much harder to extend, since any change to the way the parser works has to be done in C, and any code that relied on these changes wouldn't run on anybody else's Ruby installation. ... This may sound like an academic quibble, like a desire for purity for its own sake, but the fact is that the tools available on a Smalltalk system, like the Refactoring Browser, the Debugger (which takes "edit-and-continue" farther than many people can imagine), the various inspectors and explorers and profilers are much, much better than those available for the "scripting" languages like Ruby. I would argue that a large part of the reason for this is the open, accessible, and extensible nature of the system: nobody wants to write those tools in C, and in Smalltalk, you don't have to.
Note that I'm necessarily talking about implementations here, not language specs: clearly in JRuby, the implementation is in Java instead of C, and clearly you could implement the Ruby language with a Smalltalk-style VM (hopefully one with a Smalltalk-style JIT as well, which would bring a 20x or so speed increase to the current Ruby interpreter). But really what I'm talking about is a philosophical difference, not a technical one: to Smalltalkers, it's essential that as much of a system as possible be implemented in Smalltalk, whereas this simply isn't a priority for the scripting language community, and it's the priorities rather than the individual implementations that draw me to Smalltalk.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #193,746
2/8/05 11:08:43 PM
|
Re: You lose a lot of power though
Quoting Avi: there's no way with a stock Ruby interpreter to get at a Ruby parse tree from Ruby code. Using a stock Ruby interpreter and the ParseTree library (downloaded and installed with the single command "gem install ParseTree"), I can do this ... require 'parse_tree'\nclass Example\n def example(arg1)\n return "Blah: " + arg1.to_s\n end\nend\np ParseTree.new.parse_tree_for_method(Example, "example")\n With the output (slightly formatted): [:defn, :example, \n [:scope, \n [:block, [:args, :arg1], \n [:return, \n [:call, [:str, "Blah: "], \n :+, \n [:array, [:call, [:lvar, :arg1], :to_s]]]]]]] The above is pretty cutting edge stuff coming from Ryan Davis. Ryan is building a compiler that will take a simplified version of Ruby and compile it directly to C. The goal is to do something pretty close to what Squeak does with its implementation language. Combine this with the MetaRuby project and you get pretty close to what Avi is talking about. We're not there yet, but I definitely see movement in that direction. Again quoting Avi: the Refactoring Browser, the Debugger [...], the various inspectors and explorers and profilers [...] nobody wants to write those tools in CI'm not sure why he thinks C is required for those projects. One of my first projects in Ruby was a simple class browser, Rails has an embedded interactive debugger where you can communicate with your web deployed code, all in just plain Ruby. And now that Ryan has made it easy to reify the Ruby parse information, a refactoring browser becomes a real possibility. Grant, none of this stuff is comparable to what Smalltalk offers now, but I think real reason the two language cultures are so different is not because of the need for C, but because Smalltalk is image based and Ruby is not.
-- -- Jim Weirich jim@weirichhouse.org [link|http://onestepback.org|http://onestepback.org] --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
|
Post #193,781
2/9/05 12:48:20 PM
|
Is the parser written in Ruby?
Just curious. It does sound like Ruby is headed in the right direction in terms of having more and more of itself written in itself.
"Whenever you find you are on the side of the majority, it is time to pause and reflect" --Mark Twain
"The significant problems we face cannot be solved at the same level of thinking we were at when we created them." --Albert Einstein
"This is still a dangerous world. It's a world of madmen and uncertainty and potential mental losses." --George W. Bush
|
Post #193,808
2/9/05 2:26:55 PM
|
Just like C# and .Net
</runs for cover>
bcnu, Mikem
Eine Leute. Eine Welt. Ein F\ufffdhrer. (Just trying to be accepted in the New America)
|
Post #193,831
2/9/05 5:55:31 PM
|
Re: Is the parser written in Ruby?
Ryan's ParseTree library uses the current Ruby interpreter parser that is written in C. In fact, he doesn't actually parse the data, but just pulls out the parse tree that Ruby has already parsed. It just reifies that parse data as as Ruby objects so they can be accessed and processed by Ruby code.
This is enough to do refactoring browser type of stuff. Not enough to play syntax god with the language itself.
I believe that Ruby 2.0 will have a full Ruby invocable parser (but I'm don't know how much will be C code and how much will be Ruby code).
AFAICT, Matz himself is not too interested in the MetaRuby stuff, but he has always been willing to "take what works well" and incorporate it into Ruby. I'm hoping that Ryan's work will eventually make it into the core. Ryan's goal is to be able to write the Ruby libraries (and perhaps the VM) in a simple subset of Ruby that can easily be compiled to C code. My understanding is this is that same approach Squeak uses. Ryan has some great examples where he dynamically grabs a method object and calls both "to_c" (producing C code) and "to_ruby" (reproducing the original ruby source ... sans comments). It's pretty cool.
-- -- Jim Weirich jim@weirichhouse.org [link|http://onestepback.org|http://onestepback.org] --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
|
Post #193,834
2/9/05 6:43:11 PM
|
#3 will be possible in C# 2.0
[link|http://dotnetjunkies.com/WebLog/nenoloje/archive/2004/03/24/9862.aspx|http://dotnetjunkies...4/03/24/9862.aspx]
It's always "in the next version" isn't it ;)
-- Chris Altmann
|
Post #193,836
2/9/05 6:55:59 PM
|
But it's gonna be great!
bcnu, Mikem
Eine Leute. Eine Welt. Ein F\ufffdhrer. (Just trying to be accepted in the New America)
|
Post #194,136
2/11/05 10:01:14 AM
|
C# 2.0
I just ran into a road block with C# 1.1. We need to load domain objects from the database which means we need the ability to set number types to null. Just found there's no way to do that in C# currently.
I hear C# 2.0 will introduce nullable types ([link|http://msdn.microsoft.com/vcsharp/team/language/default.aspx|http://msdn.microsof...uage/default.aspx]). Is it save to use the 2.0 framework beta for a project that has to ship at the end of this year? Anyone have any experience with 2.0?
Thanks, John
|
Post #194,153
2/11/05 11:16:29 AM
|
Strong typing bites itself in the gonads once again
Are there software-Darwin awards?
|
Post #194,155
2/11/05 11:28:01 AM
|
Any production quality dynamic languages for .NET yet
The closest I've found is IronPython, but it's still alpha with no release schedule.
|
Post #194,215
2/11/05 2:26:02 PM
|
Not that I've seen.
IronPython is probably the strongest contender, now that Jim Hugunin is working for MS. You can chat him up about release schedule at PyCon in DC this Easter. ;)
|
Post #194,252
2/11/05 4:42:00 PM
|
Objects to the rescue
We don't want to risk developing with Microsoft beta software and we are stuck with .Net because all the developers here want a quick, easy GUI builder.
So...I'm going follow the pattern from NakedObjects, all the properties of our domain objects will be a custom value type. The value type will have a Null property. This also means I can move the code to determine if the property has changed and what it's original value is to the value object. Plus, it will force our developers to use objects for things like Money and different unit types instead of just using double.
Oh, and I just learned you have to put [Serializable] on EVERY object you want serialized. In Java, I could just place it on a single base class or interface. <sigh>
|
Post #194,368
2/12/05 2:09:08 PM
|
Sounds reasonable
Looks like C# has [link|http://www.ondotnet.com/pub/a/dotnet/2003/03/10/collections.html|type-safe collections]...maybe you can put all of your Domain Object properties into a private HashTable*, and then write public getters/setters which are Null-aware? Just a thought.
Re: the dirty logic:
If you are making an [link|http://www.martinfowler.com/eaaCatalog/activeRecord.html|Active Record] system, you might as well stick as much logic into the objects themselves.
If, on the other hand, you're making a [link|http://www.martinfowler.com/eaaCatalog/dataMapper.html|Data Mapper], you probably want to keep the "dirty logic" (whether an object has changed or not) outside your custom "value type" objects. It will make it easier for your mapper to instantiate existing objects without having them become dirty unwittingly, especially if you start adding update triggers.
* Yes, I'm forever tainted by Python ;)
|
Post #194,509
2/14/05 4:15:32 AM
|
Wibble, wibble...
Brewski Bob blithers: Looks like C# has [link|http://www.ondotnet.com/pub/a/dotnet/2003/03/10/collections.html|type-safe collections]...maybe you can put all of your Domain Object properties into a private HashTable*, and then write public getters/setters which are Null-aware? Just a thought. If that's all there's to it, then those aren't "properties". They're just private values that happen to have public getters and setters; a mere (stupid, Java-ish) *convention* -- not *actual implemented as such* properties at all. (Oh well; then again, I know of only one language that actually *does* implement a proper property mechanism...) If you are making an [link|http://www.martinfowler.com/eaaCatalog/activeRecord.html|Active Record] system, you might as well stick as much logic into the objects themselves. As much as what?
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #194,553
2/14/05 11:17:46 AM
|
Semantics
Call them whatever you want if they get the job done.
I meant "as you like", by the way.
|
Post #194,623
2/14/05 5:13:14 PM
|
A) Almost everything is, when you get down to it; and B)...
...everybody seems to be leaving off "as possible", nowadays.
Well, not *everybody* -- it seems to be Amer\ufffdcans, mostly. (I could say something about attention spans, here... But I'll leave you to come up with that for yourselves.)
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #194,706
2/15/05 12:54:43 AM
|
English is simply too flexible to be used well.
I think the problem comes up when typing such a phrase because English freely allows two different, yet equal, arrangements:
"stick as much logic [as possible] into the objects themselves"
and
"stick as much logic into the objects themselves [as possible]"
While typing, it's easy to *intend* to place the "as possible" at the end of the sentence, and then forget to do so, because your brain tricks you into thinking you already inserted "as possible" into the first slot.
Not that English is the only such language, but I think that's why I elided the words.
|
Post #194,712
2/15/05 2:41:54 AM
|
Yeah, I know - but it makes for a funny contrast...
...with German, where the grammar dictates that such spans are much more frequent, and much longer -- and you hardly ever see Germans leave off such a possibly tiny, but nonetheless vital, part.
(Then again, this could be because in German, such a fragment almost always *has* to go on the end of the sentence; which means there is a much smaller risk of thinking one has already added it.)
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #194,758
2/15/05 11:11:25 AM
|
Re: Sounds reasonable
If, on the other hand, you're making a Data Mapper [*], you probably want to keep the "dirty logic" (whether an object has changed or not) outside your custom "value type" objects. It will make it easier for your mapper to instantiate existing objects without having them become dirty unwittingly, especially if you start adding update triggers.
I am using a Data Mapper, but my mapper uses reflection and puts the data directly into the private fields, bypassing the "dirty logic". It's currently designed so my domain objects keep a map of original values and that is populated when property change events are fired. I think using the value objects will simplify this.
|
Post #194,508
2/14/05 3:59:59 AM
|
Same old bullshit.
John U. laments: We don't want to risk developing with Microsoft beta software and we are stuck with .Net because all the developers here want a quick, easy GUI builder. Still pretending you've never heard of Delphi, eh?
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #194,522
2/14/05 8:57:54 AM
|
I second that
Matthew Greet
But we must kill them. We must incinerate them. Pig after pig, cow after cow, village after village, army after army. And they call me an assassin. What do you call it when the assassins accuse the assassin? They lie. They lie and we must be merciful to those who lie. - Colonol Kurtz, Apocalypse Now.
|
Post #194,757
2/15/05 11:08:12 AM
|
Re: Same old bullshit.
Still pretending you've never heard of Delphi, eh?
If I had my choice, I'd do it in Smalltalk...
|
Post #196,170
2/24/05 2:29:35 AM
|
And WTF does that have to do with anything?
John U gibbers: If I had my choice, I'd do it in Smalltalk... So what? Apparently you don't have a free choice, but are constrained in that you need, as you put it earlier: We don't want to risk developing with Microsoft beta software Dunno if youy knew this, but Delphi actually is neither Microsoft nor beta software. and we are stuck with .Net because all the developers here want a quick, easy GUI builder. Which is exactly what Delphi is. Well, except that you aren't stuck with em-ess-dot-net if you use Delphi; it's a quick, easy GUI builder for both .Net and regular Win-32 apps. So what exactly was your excuse, again, for pretending that it doesn't exist? Just wondering, you know...
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #196,219
2/24/05 1:02:01 PM
|
Re: And WTF does that have to do with anything?
Before I came here, they tried to build a Windows version of the old COBOL software using Delphi and failed. The second try in PowerBuilder succeeded. Somehow, I don't think introducing Delphi will elicit a positive response.
|
Post #196,601
2/28/05 9:20:51 AM
|
OK, so what you originally said was only half the story.
Left out the bit about how they inexplicably screwed up something that to anyone sane just shouldn't be screwuppable... (Did they try to write a COBOL app in Delphi, or WTF?)
Oh well, never mind.
[link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad] (I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
|
Post #194,511
2/14/05 5:27:22 AM
|
OT: Inner/outer classes. (new thread)
Created as new thread #194510 titled [link|/forums/render/content/show?contentid=194510|OT: Inner/outer classes.]
Peter [link|http://www.ubuntulinux.org|Ubuntu Linux] [link|http://www.kuro5hin.org|There is no K5 Cabal] [link|http://guildenstern.dyndns.org|Home] Use P2P for legitimate purposes!
|