Re: Components: How do you reuse utility code?

2017-04-22 Thread Cannon Smith via 4D_Tech
James, I think you’ve expressed very well why more code in the 4D community isn’t shared. I know there have been many times when I wanted to share a bit of code that I thought would be helpful or in response to a question someone had. And then I realized how many “core” methods I would have to

Re: Components: How do you reuse utility code?

2017-04-22 Thread James Crate via 4D_Tech
>> IMO that is one of the biggest reasons there is no significant code-sharing >> or component community in 4D, as compared to almost any other language. >> There would need to be a “standard library” component that other components >> could depend on, or they all have to reinvent every wheel.

Re: Components: How do you reuse utility code? (long)

2017-04-22 Thread Arnaud de Montard via 4D_Tech
> Le 22 avr. 2017 à 13:16, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > I haven't measured if EXECUTE METHOD has a significant overhead to be > honest... it depends ;-) +++ ARRAY LONGINT($ms_al;2) C_LONGINT($count_l;$duration_l;$tk_l) $duration_l:=60*3 //**loop 1**

Re : Components: How do you reuse utility code? (long)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi, To be honest i am glad there a feeling of curiosity and interest about components. I have seen the light my friends and I am a believer :-) And there is hope for a "born again 4D component lovers" community. I find it sad when I hear 4D developers saying that they tried components and that

Re: Components: How do you reuse utility code? (long)

2017-04-22 Thread David Adams via 4D_Tech
On Sat, Apr 22, 2017 at 7:40 PM, Bruno LEGAY via 4D_Tech < 4d_tech@lists.4d.com> wrote: Bruno, I hope that everyone agrees with me that your post was just fantastic. Thank you very much for sharing your point of view, specifics about what you've done, and why. A very substantial and interesting

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread David Adams via 4D_Tech
> If you want to communicate with host and or other components => use callbacks. As it turns out, what I am validating is the method name being passed into the component for a callback! This is a database exploiting CALL WORKER and CALL FORM to implement a Publish/Subscribe messaging pattern.

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread David Adams via 4D_Tech
Bruno, Thanks a lot for the answer and background info. I think I expressed myself unclearly regarding errors in my original post. I'm not trying to delegate error handling to a component. I hadn't really thought about it yet. Instead, what I'm talking about is a custom error stack that I use.

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread Arnaud de Montard via 4D_Tech
> Le 22 avr. 2017 à 11:09, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > [...] > This may look OTT but there are very few method where this is really > necessary[...] Hi Bruno, in system document management I needed a bunch of 'on error call'… -- Arnaud de Montard

Re: Components: How do you reuse utility code? (long)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi, To be honest i am glad there a feeling of curiosity and interest about components. I have seen the light my friends and I am a believer :-) And there is hope for a "born again 4D component lovers" community. I find it sad when I hear 4D developers saying that they tried components and that

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi David, On your original message (sorry for the late response, been very busy this week). First about, component are not russian dolls. Then about error handling, you need to set up a simple test environment to understand how they work. An error in the component, if not "trapped" will be

Re: Components: How do you reuse utility code?

2017-04-21 Thread David Adams via 4D_Tech
On Sat, Apr 22, 2017 at 12:44 PM, Peter Jakobsson via 4D_Tech < 4d_tech@lists.4d.com> wrote: > A single developer needs to reproduce the same code over again for many > applications. A component-based approach requires them to distill out and > de-couple business logic so that it is explicitly

Re: Components: How do you reuse utility code?

2017-04-21 Thread Peter Jakobsson via 4D_Tech
Jim - I read all of your post with interest. But with respect, IMHO it really does not do the least bit of justice to the real world applications that 4D’s component architecture is designed to address. Nor does it reflect the practice of a component based development paradigm. For example

Re: Components: How do you reuse utility code?

2017-04-21 Thread David Adams via 4D_Tech
Jim Crate wrote: > Depends on what you consider 3GL vs 4GL Yeah, I find the terms unhelpful. They aren't crisp enough to mean anything useful without a lot of discussion about what you mean by each term first ;-) > These are both tight coupling. This is compile-time vs runtime binding. I'm

Re: Components: How do you reuse utility code?

2017-04-21 Thread James Crate via 4D_Tech
On Apr 21, 2017, at 12:41 PM, Peter Jakobsson via 4D_Tech <4d_tech@lists.4d.com> wrote: > > On 21 Apr 2017, at 02:44, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote: > >> I think we sometimes forget that 4D is not a 3GL programming language like C >> or C++. 4D is a 4GL language. You

Re: Components: How do you reuse utility code?

2017-04-21 Thread David Adams via 4D_Tech
On Sat, Apr 22, 2017 at 2:41 AM, Peter Jakobsson via 4D_Tech < 4d_tech@lists.4d.com> wrote: What a fantastic post! Peter, thanks so much for taking the time to share your point of view and knowledge. This is a help to me now, and an excellent contribution to the archives. I've already said my

Re: Components: How do you reuse utility code?

2017-04-21 Thread Tim Nevels via 4D_Tech
On Apr 21, 2017, at 2:00 PM, Peter Jakobsson wrote: > On 21 Apr 2017, at 02:44, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote: > >> I think we sometimes forget that 4D is not a 3GL programming language like C >> or C++. 4D is a 4GL language. You don’t get all the feature, benefits and >>

Re: Components: How do you reuse utility code?

2017-04-21 Thread Robert McKeever via 4D_Tech
Remember subtables inside of subtables? (4D v1.xxx). Lots of fun - if used right. > On Apr 21, 2017, at 8:31 AM, Keith White via 4D_Tech <4d_tech@lists.4d.com> > wrote: > >> If they did care, some of these things could have been added instead of >> querying on object fields that most people

Re: Components: How do you reuse utility code?

2017-04-21 Thread Peter Jakobsson via 4D_Tech
On 21 Apr 2017, at 02:44, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote: > I think we sometimes forget that 4D is not a 3GL programming language like C > or C++. 4D is a 4GL language. You don’t get all the feature, benefits and > capabilities of a 3GL language in a 4GL language. Remember

Re: Components: How do you reuse utility code?

2017-04-21 Thread Keith White via 4D_Tech
>If they did care, some of these things could have been added instead of >querying on object fields that most people will eventually wish they didn’t >use in the first place. This made me smile a lot.I had exactly the same thought. It brings back memories of subtables which I'm sure every

Re: Components: How do you reuse utility code?

2017-04-21 Thread John DeSoi via 4D_Tech
I'm fairly new to components also, and what you describe below is pretty much how I'm doing it. Anything reusable goes in one component library. But I want to use different subsets of this for different projects. I have "build methods" which specify which methods (modules) should be shared for

Re: Components: How do you reuse utility code?

2017-04-21 Thread David Adams via 4D_Tech
On Fri, Apr 21, 2017 at 2:45 PM, Tim Nevels via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Just before I clicked “Send” on my post I thought “this is probably gonna > crawl under David’s skin, I can’t wait to read his reply”. You certainly > did not disappoint. :) And that is a smiley face because

Re: Components: How do you reuse utility code?

2017-04-21 Thread David Adams via 4D_Tech
On Fri, Apr 21, 2017 at 2:39 PM, James Crate via 4D_Tech < 4d_tech@lists.4d.com> wrote: > A few more less important things that are in almost every modern language > that would make coding nicer for everyone, and could be added without > affecting legacy code: > +1 on your list. And while The

Re: Components: How do you reuse utility code?

2017-04-20 Thread Tim Nevels via 4D_Tech
On Apr 20, 2017, at 10:23 PM, David Adams wrote: > Tim, I finally said "what the heck" and am giving my blunt opinions below. > Don't take the torrent as directed at you. I think that you made an > intelligent and high-level argument. I mean, you're wrong, but at I don't > hold that against you

Re: Components: How do you reuse utility code?

2017-04-20 Thread James Crate via 4D_Tech
On Apr 20, 2017, at 9:42 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote: > And again, I'm not asking for 4D to do a completely new language. No > thanks, we have a zillion modern languages to choose from. I'm asking for a > sensible evolution of the language: > > * Data structures

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
Don't forget the Pascal guy Niklaus Wirth Regards, Wayne [image: --] Wayne Stewart [image: http://]about.me/waynestewart On 21 April 2017 at 11:56, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote: > Speaking of nerd crushes, here are the names of people

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
One of the big pluses of EXECUTE METHOD is working around does this exist? If the component is present run this method if it isn't don't try. And of course, it completely hides the need for a component from 4D. This can be very useful. On a number of occasions I've tried to open a structure and

Re: Components: How do you reuse utility code?

2017-04-20 Thread David Adams via 4D_Tech
Speaking of nerd crushes, here are the names of people that I find particularly inspirational for the broad and lasting contributions they've made (or are making) to our fields. Other people will have their own equally sensible lists: Mike Bostock Edsger W. Dijkstra Martin Fowler Steve McConnell

Re: Components: How do you reuse utility code?

2017-04-20 Thread David Adams via 4D_Tech
Tim, I finally said "what the heck" and am giving my blunt opinions below. Don't take the torrent as directed at you. I think that you made an intelligent and high-level argument. I mean, you're wrong, but at I don't hold that against you ;-) That's not an ironic smiley face...I grew up in schools

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
You can have components calling other components from within a host database. Host Component A Component B Option 1: Easy! If Component A calls B, then during development of A you need to have a copy of B in its component folder. To compile Comp A you must have a compiled version of Comp B.

Re: Components: How do you reuse utility code?

2017-04-20 Thread Tim Nevels via 4D_Tech
> On Apr 20, 2017, at 6:04 PM,David Adams wrote: > > That makes sense. I guess what I'm trying to get advice on is how to share > utility code with a host and other components: > > MyBigDatabase > |Components > |ErrorStack > |ErrorStack.4dbase >

Re: Components: How do you reuse utility code?

2017-04-20 Thread David Adams via 4D_Tech
> > Or I write a local method to take over that function from the component. > > There are two ways to spot duplicated methods: 1) they appear as warnings > > in the complier > > Not for me they don't. I've set this up on purpose and they aren't > detected. Okay, I've seen it now for the first

Re: Components: How do you reuse utility code?

2017-04-20 Thread David Adams via 4D_Tech
> > Does the above work? > > > ​Yes. but. the times I've tried it really got to be a mess. So then, "no" :( > I should point out, though, that my style of programming stays away from > large memory blocks that I expect to be stable or controlled during the > life of the session. I use some of

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
Components calling components? Get used to EXECUTE METHOD, this works and is the easiest way to achieve this. Of course it sort of negates the benefits of compiling so don't do it in a loop! That's why the Foundation shell went from a bunch of small components in 2003/2004 days to one big

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
Hi, Feature Request for different style in method editor: http://forums.4d.fr/Post//19321897/1/ Regards, Wayne [image: --] Wayne Stewart [image: http://]about.me/waynestewart On 21 April 2017 at 09:04, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> wrote: >

Re: Components: How do you reuse utility code?

2017-04-20 Thread Kirk Brooks via 4D_Tech
David, On Thu, Apr 20, 2017 at 3:22 PM, David Adams via 4D_Tech < 4d_tech@lists.4d.com> wrote: > On Thu, Apr 20, 2017 at 16:57 Kirk Brooks via 4D_Tech < > 4d_tech@lists.4d.com> > wrote: > > > 1) as a repository for a core set of functions > > 2) as more or less independent sub-programs > > That

Re: Components: How do you reuse utility code?

2017-04-20 Thread David Adams via 4D_Tech
On Thu, Apr 20, 2017 at 16:57 Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> wrote: > 1) as a repository for a core set of functions > 2) as more or less independent sub-programs That makes sense. I guess what I'm trying to get advice on is how to share utility code with a host and other

Re: Components: How do you reuse utility code?

2017-04-20 Thread Arnaud de Montard via 4D_Tech
> Le 20 avr. 2017 à 08:01, David Adams via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > [...] I've got a standard module called ErrorStack where > I can, well, stack errors. [...] I gave up on a "complete" error management embedded in a component, in 4D it mostly relies on process variables

Re: Components: How do you reuse utility code?

2017-04-20 Thread Wayne Stewart via 4D_Tech
David, I would forget about the error stack idea. Kirk's thoughts are all good except beware the Object one (putting Cannon's module in a component). I did that but… somethings work slightly different, off the top of my head I can't recall what they are. In the end I just gave up and copied the

Re: Components: How do you reuse utility code?

2017-04-20 Thread Jim Dorrance via 4D_Tech
I prefix all methods shared with the host with an underscore so I can easily see what I have shared. > -- Jim Dorrance jim.dorra...@gmail.com 4...@dorrance.eu www.4d.dorrance.eu PS: If you know of anyone that needs an experienced 4D programmer to add energy and experience to their team, please