Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Shaggar
Apr 26, 2006
There are things im not talking about here like build goals and other details im omitting so the maven docs might give you more ideas.

really the best resource for maven is people who already know how to use maven cause some stuff is not immediately obvious. Once you get it, though, you're mind will expand and you will understand that with maven all things are possible.

Adbot
ADBOT LOVES YOU

BONGHITZ
Jan 1, 1970

extreme

Workaday Wizard
Oct 23, 2009

by Pragmatica
you are a treasure shaggar :worship:

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Shaggar posted:

There are things im not talking about here like build goals and other details im omitting so the maven docs might give you more ideas.

really the best resource for maven is people who already know how to use maven cause some stuff is not immediately obvious. Once you get it, though, you're mind will expand and you will understand that with maven all things are possible.

do you prefer maven to gradle? if so why?

TheresNoThyme
Nov 23, 2012

Shaggar posted:

really the best resource for maven is people who already know how to use maven cause some stuff is not immediately obvious.

Yea seriously. All it takes is one option you don't understand you'll be spending five hours trying to figure out why dependency x is magically missing when you deploy to a server.

That said maven owns it's just dependency hell that sucks. Shaggar what are your thoughts on parent pomfiles since you seem to have a lot of experience on good maven practices? I just refactored our pom structure at work from an impossible-to-manage 5-parents-deep pomfile into a single parent pom that does dependency management + builds/plugins/stuff and then a single child pom that does all dependencies on a per-app basis and is preloaded in our archetype with the usual suspects (I may change it later but I was mostly interested on fixing the current clusterfuck). This is for a workplace with 5+ app teams of varying skill starting new projects every 3-6 months so having good basic structure is pretty important.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
hello my company probably needs to hire a consultant who knows chef to write a bunch of recipes so our servers do what we want

are we going to pay a fuckton of money for this? what's the going rate on devops consultants?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Blinkz0rz posted:

hello my company probably needs to hire a consultant who knows chef to write a bunch of recipes so our servers do what we want

are we going to pay a fuckton of money for this? what's the going rate on devops consultants?

probably depends on the scale you're talking about.

Shaggar
Apr 26, 2006

syntaxrigger posted:

do you prefer maven to gradle? if so why?

I've never used gradle, but it looks like it was made by someone who was mad it was hard to do their terrible ant scripts in maven. The idea behind maven is that you define your project, its dependencies, and what the output should look like and maven figures out how to build it. The complete separation of your project definition from the executing code makes builds far more manageable.

It also means if you want to add custom functionality you need to build a maven plugin. This is obviously gonna be a problem for the Linux crew where everything must be reinvented every time, but for those of us who work for a living there are already plugins for everything we're doing.


TheresNoThyme posted:

Yea seriously. All it takes is one option you don't understand you'll be spending five hours trying to figure out why dependency x is magically missing when you deploy to a server.

That said maven owns it's just dependency hell that sucks. Shaggar what are your thoughts on parent pomfiles since you seem to have a lot of experience on good maven practices? I just refactored our pom structure at work from an impossible-to-manage 5-parents-deep pomfile into a single parent pom that does dependency management + builds/plugins/stuff and then a single child pom that does all dependencies on a per-app basis and is preloaded in our archetype with the usual suspects (I may change it later but I was mostly interested on fixing the current clusterfuck). This is for a workplace with 5+ app teams of varying skill starting new projects every 3-6 months so having good basic structure is pretty important.

dependency hell has never really been a problem for me in java cause I like to build lots of small services instead of compiling them all together. I also tend to stick with versions of stuff that I know works which means dependencies don't change much and are predictable. a single parent project with multiple child projects is as far as I'd go w/ the children being modules separated by purpose. ex: one child for api definition, another child for implementation, and another for deployment. or if the api is shared across parent projects, then just impl and deployment. Although even then I'm primarily using the relationship for organization rather then dependency management.

Creating archetypes for common project layouts w/ deps is a good idea tho. I use it for some of my service projects and where you're dev org is way larger than mine it probably makes sense to force people into that structure as soon as they build the project.

although maybe don't even use parent projects. Idk. you don't need the hierarchy to inherit dependencies from projects you're project is dependent on. its really more important for things like properties and build configurations which aren't inherited. if you aren't doing that then maybe don't use parent poms.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

MALE SHOEGAZE posted:

probably depends on the scale you're talking about.

p small to be honest

we just need templated server configs for a few scenarios. afaik nothing involving scaling or anything complicated like that. one needs to be apache + php-fpm so we can host a bunch of sites off one box, another needs to be configured for green unicorn deployments. i think that's about it actually.

i really just don't want to learn chef and spend the time trying to figure out how to do this when we could probably pay someone to do a much better job

Stringent
Dec 22, 2004


image text goes here

Blinkz0rz posted:

p small to be honest

we just need templated server configs for a few scenarios. afaik nothing involving scaling or anything complicated like that. one needs to be apache + php-fpm so we can host a bunch of sites off one box, another needs to be configured for green unicorn deployments. i think that's about it actually.

i really just don't want to learn chef and spend the time trying to figure out how to do this when we could probably pay someone to do a much better job

chef itself is dirt simple, the problem is always knowing how the box needs to be configured. if you know exactly how things are supposed to be set up then it's probably worth your while to learn chef.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Stringent posted:

chef itself is dirt simple, the problem is always knowing how the box needs to be configured. if you know exactly how things are supposed to be set up then it's probably worth your while to learn chef.

i'm not an ops guy and don't want to be an ops guy

i know what stack my apps run on and i need something that configures them the same time everytime and provisions my vagrant boxes

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Shaggar posted:

I've never used gradle, but it looks like it was made by someone who was mad it was hard to do their terrible ant scripts in maven. The idea behind maven is that you define your project, its dependencies, and what the output should look like and maven figures out how to build it. The complete separation of your project definition from the executing code makes builds far more manageable.

It also means if you want to add custom functionality you need to build a maven plugin. This is obviously gonna be a problem for the Linux crew where everything must be reinvented every time, but for those of us who work for a living there are already plugins for everything we're doing.

<..other stuff..>

thanks shags

Shaggar
Apr 26, 2006
also if you actually need custom scripting code, doing it in a plugin allows you to build and test it independent of whatever projects might use it. you can then deploy it to your own nexus repo to be used by everyone.

idk if anyone already does this, but maven could probably be used as a system configuration tool like chef if you wrote the plugins for it. then instead of having to deal with a horrible p-lang based scripting language, you just define the system state you want and maven sets it up.

Soricidus
Oct 21, 2010
freedom-hating statist shill
everything you need to know about gradle in two sentences:

quote:

The whole Gradle API is fully groovynized. Only by that using Groovy is the fun and productivity gain it can be.
sounds like a pretty compelling reason to stick with maven if you ask me

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
whats groovy?

https://www.youtube.com/watch?v=mWBvcJAXwu4

Luigi Thirty
Apr 30, 2006

Emergency confection port.


expected austin powers, didn't get it

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

cls: eclipse still sucks, even more so on ubuntu and even MORE so with the Spring Source Tool Suite

gently caress spring.io for having guides that are poo poo and misleading

gently caress eclipse for the millionth time

guess i'll check out of netbeans can make this crappy spring guide project run with ubuntu

poo poo man all i want to do is program in java and dust off the cobwebs so i can get a better job than my lovely current one. I now remember why I ran away from Java to start with. It hates you and doesn't want you to program. It would rather you spend eternity in configuration hell because the JVM is fueled by shattered dreams and hate.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

so if i want a wpf button to execute a method in my viewmodel (not in the window class because it doesn't go there) how does that work? google says i need some third-party libraries because microsoft screwed up or something but all the results are from like 2011 so idk

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Luigi Thirty posted:

so if i want a wpf button to execute a method in my viewmodel (not in the window class because it doesn't go there) how does that work? google says i need some third-party libraries because microsoft screwed up or something but all the results are from like 2011 so idk
you use the codebehind to set the view's DataContext to be an instance of the viewmodel

you add a Command property to the viewmodel

you bind the button to the Command property of the implicit DataContext

in the viewmodel constructor you connect the Command to the method. idk how you do it in vanilla WPF i always use reactiveui

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
though that question is a red flag. after your last adventure in nailing together stackoverflow answers, you still haven't read a book?

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Shaggar posted:

There are things im not talking about here like build goals and other details im omitting so the maven docs might give you more ideas.

really the best resource for maven is people who already know how to use maven cause some stuff is not immediately obvious. Once you get it, though, you're mind will expand and you will understand that with maven all things are possible.

drat, you could be a build-and-release guy. you ever consider it?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

coffeetable posted:

though that question is a red flag. after your last adventure in nailing together stackoverflow answers, you still haven't read a book?

on c# but not on wpf! i got everything working in winforms no problem

Brain Candy
May 18, 2006

prefect posted:

drat, you could be a build-and-release guy. you ever consider it?

you become the build-and-release guy because there's no other choice if you want good builds, not because you want to

its completely thankless janitoring

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
the build-and-release guy here is the most recent devops hire

Quebec Bagnet
Apr 28, 2009

mess with the honk
you get the bonk
Lipstick Apathy

coffeetable posted:

in the viewmodel constructor you connect the Command to the method. idk how you do it in vanilla WPF i always use reactiveui

usually the solution is called DelegateCommand or RelayCommand which for some reason isn't included in the framework but is like 10 lines of code

does what it says on the tin: you give it Action<T>s or delegates for CanExecute and Execute

z0rlandi viSSer
Nov 5, 2013

Blinkz0rz posted:

hello my company probably needs to hire a consultant who knows chef to write a bunch of recipes so our servers do what we want

are we going to pay a fuckton of money for this? what's the going rate on devops consultants?

change your username immedaitely

Shaggar
Apr 26, 2006

Luigi Thirty posted:

so if i want a wpf button to execute a method in my viewmodel (not in the window class because it doesn't go there) how does that work? google says i need some third-party libraries because microsoft screwed up or something but all the results are from like 2011 so idk

Yeah its definitely a little weird and the underlying reason is that you cant bind events in your view to handlers in your viewmodel. Instead you're supposed to bind stuff via the ICommand interface. You'll notice on most controls that take user input theres a Command property, button has one as well. So in your viewmodel you'll have a property named ClickCommand or w/e that is of a type that inherits from ICommand and then on your button you'd do <Button Command="{Binding ClickCommand"}/> When button is clicked it relays the event to your command object which handles the event.

ICommand defines 3 things that the binder uses for stuff. Execute, CanExecute, and CanExecuteChanged. Execute executes the command (duh) and CanExecute determines if the command is currently executable (duh). This way the control with a command can set its own state based on the state of your viewmodel's Command.

so wrt Button sometimes you want to disable the button until certain conditions are met (ex: validating form fields before submission is allowed). You can bind something to the Enabled property of button OR if you bind the Command property, the button will use CanExecute to set Enabled for you.

For Button where there's really only one event (click) that you want to fire having one Command to bind to makes sense. This design fails pretty hard when you get into more complex input. Every control has a base set of events (mouse in, mouse out, mouse down, etc...) and stuff like TextField has events for character input, etc... All of those events cant be bound directly in your viewmodel. So you have 3 options:

1) Stick an event handler in the codebehind of your view and then either handle the event there or forward the event to your viewmodel. This is what most people do when getting started and its not always the wrong choice even when going mvvm.
2) Extend the control you're using to add bindable Commands for each event you want to deal w/. This is a good idea if you're gonna reuse the custom control a lot.
3) Do what Microsoft does and use System.Windows.Interactivity to hack it up and translate the event to a command:
Add System.Windows.Interactivity as a reference to your project thru nuget or w/e
In your xaml add the namespace like this: xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
Then add some markup to your control to bind the event like this:
XML code:
<Button ...>
	<i:Interaction.Triggers>
		<i:EventTrigger EventName="MouseEnter" >
			<i:InvokeCommandAction Command="{Binding MouseEnterCommand}" />
		</i:EventTrigger>
	</i:Interaction.Triggers>
</Button
or w/e other eventname you want to bind.

Theres a decent article here: http://blog.magnusmontin.net/2013/06/30/handling-events-in-an-mvvm-wpf-application/

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

z0rlandi viSSer posted:

change your username immedaitely

regdate bitch

Shaggar
Apr 26, 2006

prefect posted:

drat, you could be a build-and-release guy. you ever consider it?

im already underpaid

Notorious b.s.d.
Jan 25, 2003

by Reene

Soricidus posted:

everything you need to know about gradle in two sentences:

sounds like a pretty compelling reason to stick with maven if you ask me

groovy is perfectly nice. the problem with gradle, sbt, lein, et al is that using code to model a project structure is not a real good idea. we put code in your code so you can code while you code!

maven pushes as much functionality as possible into machine-readable metadata. you can parse a maven pom into a useful data structure in memory and do things with it.

it makes it hard to do super-weird one off custom stuff by design.

Brain Candy
May 18, 2006

prefect posted:

i'm not a real developer -- it's not like people generally need a release engineer. kind of a special-needs situation

oic, sorry dude :smith:

CPColin
Sep 9, 2003

Big ol' smile.
code:
		catch (IOException ioe) {
			throw new WrapperException(WrapperExceptionCode.MAPI_IO_EXCEPTION, "Exception: '" + ioe + "'");
		}
This is not how wrappers work, Brightcove API developers.

Shaggar
Apr 26, 2006

Notorious b.s.d. posted:

groovy is perfectly nice. the problem with gradle, sbt, lein, et al is that using code to model a project structure is not a real good idea. we put code in your code so you can code while you code!

maven pushes as much functionality as possible into machine-readable metadata. you can parse a maven pom into a useful data structure in memory and do things with it.

it makes it hard to do super-weird one off custom stuff by design.

yeah because the pom is just definition it means you can remove or add to the definition or change the definition based on context very easily. with a code based build you have to understand the code before you can do those same alterations. maven rules.

Soricidus
Oct 21, 2010
freedom-hating statist shill
just replaced some dumbass's 500-line bespoke ant script with hardcoded paths to local jars and poo poo with a pom that literally just lists a couple of dependencies. life is good.

Share Bear
Apr 27, 2004

Shaggar posted:

nah, lets back up a bit.
...

what books or resources did you use to understand how eclipse and all this stuff is working? i'm constantly impressed by your knowledge in regards to java building and development

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Notorious b.s.d. posted:

groovy is perfectly nice. the problem with gradle, sbt, lein, et al is that using code to model a project structure is not a real good idea. we put code in your code so you can code while you code!

maven pushes as much functionality as possible into machine-readable metadata. you can parse a maven pom into a useful data structure in memory and do things with it.

it makes it hard to do super-weird one off custom stuff by design.

i'm working with gradle, and i don't feel bad about it, but i do see the immense sensibility of the mavenish approach (even though it can be tedious at times)

master of the sea
Apr 16, 2003

*skweeeeeee*
i want to get started on ios / os x development, should i wait for the next xcode and learn swift or should i learn the current APIs with obj-c?
what is a good starting point?
i know c++, python and perl to begin with, i have written small test stuff in obj-c but i don't yet feel comfortable in it.

FamDav
Mar 29, 2008

master of the sea posted:

i want to get started on ios / os x development, should i wait for the next xcode and learn swift or should i learn the current APIs with obj-c?
what is a good starting point?
i know c++, python and perl to begin with, i have written small test stuff in obj-c but i don't yet feel comfortable in it.

you should learn obj-c because you will inevitably have to interface with it and swift is not nearly as hard to pick up given the languages you know.

master of the sea
Apr 16, 2003

*skweeeeeee*

FamDav posted:

you should learn obj-c because you will inevitably have to interface with it and swift is not nearly as hard to pick up given the languages you know.

ok, cool, one thing i often struggle with is the design of the objects, is there a good resource on object oriented design i can read?

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

master of the sea posted:

ok, cool, one thing i often struggle with is the design of the objects, is there a good resource on object oriented design i can read?
just make singletons op

  • Locked thread